// $ANTLR 3.2 Sep 23, 2009 14:05:07 com/dyuproject/protostuff/parser/ProtoParser.g 2011-10-24 17:21:27

    package com.dyuproject.protostuff.parser;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;

import org.antlr.runtime.tree.*;

public class ProtoParser extends AbstractParser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "ASSIGN", "AT", "LEFTCURLY", "RIGHTCURLY", "LEFTPAREN", "RIGHTPAREN", "LEFTSQUARE", "RIGHTSQUARE", "SEMICOLON", "COMMA", "PLUS", "MINUS", "TO", "TRUE", "FALSE", "PKG", "SYNTAX", "IMPORT", "OPTION", "MESSAGE", "SERVICE", "ENUM", "REQUIRED", "OPTIONAL", "REPEATED", "EXTENSIONS", "EXTEND", "GROUP", "RPC", "RETURNS", "INT32", "INT64", "UINT32", "UINT64", "SINT32", "SINT64", "FIXED32", "FIXED64", "SFIXED32", "SFIXED64", "FLOAT", "DOUBLE", "BOOL", "STRING", "BYTES", "DEFAULT", "MAX", "VOID", "ID", "FULL_ID", "NUMINT", "EXP", "NUMFLOAT", "NUMDOUBLE", "HEX_DIGIT", "HEX", "OCTAL", "COMMENT", "WS", "ESC_SEQ", "STRING_LITERAL", "UNICODE_ESC", "OCTAL_ESC", "OPTIONS"
    };
    public static final int OPTION=22;
    public static final int FULL_ID=53;
    public static final int OCTAL_ESC=66;
    public static final int PKG=19;
    public static final int NUMFLOAT=56;
    public static final int MAX=50;
    public static final int FLOAT=44;
    public static final int FIXED64=41;
    public static final int ID=52;
    public static final int EOF=-1;
    public static final int AT=5;
    public static final int SYNTAX=20;
    public static final int LEFTPAREN=8;
    public static final int EXTEND=30;
    public static final int IMPORT=21;
    public static final int ESC_SEQ=63;
    public static final int STRING_LITERAL=64;
    public static final int EXTENSIONS=29;
    public static final int SINT64=39;
    public static final int LEFTCURLY=6;
    public static final int EXP=55;
    public static final int HEX=59;
    public static final int COMMA=13;
    public static final int FIXED32=40;
    public static final int RIGHTCURLY=7;
    public static final int SFIXED32=42;
    public static final int DOUBLE=45;
    public static final int MESSAGE=23;
    public static final int PLUS=14;
    public static final int VOID=51;
    public static final int NUMDOUBLE=57;
    public static final int COMMENT=61;
    public static final int NUMINT=54;
    public static final int SINT32=38;
    public static final int RETURNS=33;
    public static final int TO=16;
    public static final int INT64=35;
    public static final int RIGHTSQUARE=11;
    public static final int UNICODE_ESC=65;
    public static final int DEFAULT=49;
    public static final int BOOL=46;
    public static final int REPEATED=28;
    public static final int HEX_DIGIT=58;
    public static final int SEMICOLON=12;
    public static final int REQUIRED=26;
    public static final int MINUS=15;
    public static final int TRUE=17;
    public static final int UINT64=37;
    public static final int OPTIONAL=27;
    public static final int INT32=34;
    public static final int GROUP=31;
    public static final int WS=62;
    public static final int ENUM=25;
    public static final int SERVICE=24;
    public static final int RIGHTPAREN=9;
    public static final int LEFTSQUARE=10;
    public static final int SFIXED64=43;
    public static final int BYTES=48;
    public static final int ASSIGN=4;
    public static final int RPC=32;
    public static final int OCTAL=60;
    public static final int UINT32=36;
    public static final int FALSE=18;
    public static final int OPTIONS=67;
    public static final int STRING=47;

    // delegates
    // delegators


        public ProtoParser(TokenStream input) {
            this(input, new RecognizerSharedState());
        }
        public ProtoParser(TokenStream input, RecognizerSharedState state) {
            super(input, state);
             
        }
        
    protected TreeAdaptor adaptor = new CommonTreeAdaptor();

    public void setTreeAdaptor(TreeAdaptor adaptor) {
        this.adaptor = adaptor;
    }
    public TreeAdaptor getTreeAdaptor() {
        return adaptor;
    }

    public String[] getTokenNames() { return ProtoParser.tokenNames; }
    public String getGrammarFileName() { return "com/dyuproject/protostuff/parser/ProtoParser.g"; }


    public static class parse_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "parse"
    // com/dyuproject/protostuff/parser/ProtoParser.g:52:1: parse[Proto proto] : ( statement[proto] )+ EOF ;
    public final ProtoParser.parse_return parse(Proto proto) throws RecognitionException {
        ProtoParser.parse_return retval = new ProtoParser.parse_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token EOF2=null;
        ProtoParser.statement_return statement1 = null;


        Object EOF2_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:53:5: ( ( statement[proto] )+ EOF )
            // com/dyuproject/protostuff/parser/ProtoParser.g:53:9: ( statement[proto] )+ EOF
            {
            root_0 = (Object)adaptor.nil();

            // com/dyuproject/protostuff/parser/ProtoParser.g:53:9: ( statement[proto] )+
            int cnt1=0;
            loop1:
            do {
                int alt1=2;
                switch ( input.LA(1) ) {
                case AT:
                case PKG:
                case SYNTAX:
                case IMPORT:
                case OPTION:
                case MESSAGE:
                case SERVICE:
                case ENUM:
                case EXTEND:
                    {
                    alt1=1;
                    }
                    break;

                }

                switch (alt1) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:53:10: statement[proto]
            	    {
            	    pushFollow(FOLLOW_statement_in_parse178);
            	    statement1=statement(proto);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, statement1.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt1 >= 1 ) break loop1;
            	    if (state.backtracking>0) {state.failed=true; return retval;}
                        EarlyExitException eee =
                            new EarlyExitException(1, input);
                        throw eee;
                }
                cnt1++;
            } while (true);

            EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_parse183); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                          
                          proto.postParse();
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "parse"

    public static class statement_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "statement"
    // com/dyuproject/protostuff/parser/ProtoParser.g:61:1: statement[Proto proto] : ( header_syntax[proto] | header_package[proto] | header_import[proto] | header_option[proto] | message_block[proto, null] | enum_block[proto, null] | extend_block[proto, null] | service_block[proto] | annotation_entry[proto] );
    public final ProtoParser.statement_return statement(Proto proto) throws RecognitionException {
        ProtoParser.statement_return retval = new ProtoParser.statement_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        ProtoParser.header_syntax_return header_syntax3 = null;

        ProtoParser.header_package_return header_package4 = null;

        ProtoParser.header_import_return header_import5 = null;

        ProtoParser.header_option_return header_option6 = null;

        ProtoParser.message_block_return message_block7 = null;

        ProtoParser.enum_block_return enum_block8 = null;

        ProtoParser.extend_block_return extend_block9 = null;

        ProtoParser.service_block_return service_block10 = null;

        ProtoParser.annotation_entry_return annotation_entry11 = null;



        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:62:5: ( header_syntax[proto] | header_package[proto] | header_import[proto] | header_option[proto] | message_block[proto, null] | enum_block[proto, null] | extend_block[proto, null] | service_block[proto] | annotation_entry[proto] )
            int alt2=9;
            switch ( input.LA(1) ) {
            case SYNTAX:
                {
                alt2=1;
                }
                break;
            case PKG:
                {
                alt2=2;
                }
                break;
            case IMPORT:
                {
                alt2=3;
                }
                break;
            case OPTION:
                {
                alt2=4;
                }
                break;
            case MESSAGE:
                {
                alt2=5;
                }
                break;
            case ENUM:
                {
                alt2=6;
                }
                break;
            case EXTEND:
                {
                alt2=7;
                }
                break;
            case SERVICE:
                {
                alt2=8;
                }
                break;
            case AT:
                {
                alt2=9;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;
            }

            switch (alt2) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:62:9: header_syntax[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_header_syntax_in_statement211);
                    header_syntax3=header_syntax(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, header_syntax3.getTree());

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:63:9: header_package[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_header_package_in_statement222);
                    header_package4=header_package(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, header_package4.getTree());

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:64:9: header_import[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_header_import_in_statement233);
                    header_import5=header_import(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, header_import5.getTree());

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:65:9: header_option[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_header_option_in_statement244);
                    header_option6=header_option(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, header_option6.getTree());

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:66:9: message_block[proto, null]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_message_block_in_statement255);
                    message_block7=message_block(proto, null);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, message_block7.getTree());

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:67:9: enum_block[proto, null]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_enum_block_in_statement266);
                    enum_block8=enum_block(proto, null);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_block8.getTree());

                    }
                    break;
                case 7 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:68:9: extend_block[proto, null]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_extend_block_in_statement277);
                    extend_block9=extend_block(proto, null);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, extend_block9.getTree());

                    }
                    break;
                case 8 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:69:9: service_block[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_service_block_in_statement288);
                    service_block10=service_block(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, service_block10.getTree());

                    }
                    break;
                case 9 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:70:9: annotation_entry[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_annotation_entry_in_statement299);
                    annotation_entry11=annotation_entry(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_entry11.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "statement"

    public static class var_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "var"
    // com/dyuproject/protostuff/parser/ProtoParser.g:74:1: var : ( ID | TO | PKG | SYNTAX | IMPORT | OPTIONS | MESSAGE | SERVICE | ENUM | REQUIRED | OPTIONAL | REPEATED | EXTENSIONS | EXTEND | GROUP | RPC | RETURNS | INT32 | INT64 | UINT32 | UINT64 | SINT32 | SINT64 | FIXED32 | FIXED64 | SFIXED32 | SFIXED64 | FLOAT | DOUBLE | BOOL | STRING | BYTES | DEFAULT | MAX | VOID );
    public final ProtoParser.var_return var() throws RecognitionException {
        ProtoParser.var_return retval = new ProtoParser.var_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set12=null;

        Object set12_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:75:5: ( ID | TO | PKG | SYNTAX | IMPORT | OPTIONS | MESSAGE | SERVICE | ENUM | REQUIRED | OPTIONAL | REPEATED | EXTENSIONS | EXTEND | GROUP | RPC | RETURNS | INT32 | INT64 | UINT32 | UINT64 | SINT32 | SINT64 | FIXED32 | FIXED64 | SFIXED32 | SFIXED64 | FLOAT | DOUBLE | BOOL | STRING | BYTES | DEFAULT | MAX | VOID )
            // com/dyuproject/protostuff/parser/ProtoParser.g:
            {
            root_0 = (Object)adaptor.nil();

            set12=(Token)input.LT(1);
            if ( input.LA(1)==TO||(input.LA(1)>=PKG && input.LA(1)<=IMPORT)||(input.LA(1)>=MESSAGE && input.LA(1)<=ID)||input.LA(1)==OPTIONS ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set12));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "var"

    public static class annotation_entry_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "annotation_entry"
    // com/dyuproject/protostuff/parser/ProtoParser.g:82:1: annotation_entry[Proto proto] : AT var ( LEFTPAREN annotation_keyval[proto, annotation] ( COMMA annotation_keyval[proto, annotation] )* RIGHTPAREN )? ;
    public final ProtoParser.annotation_entry_return annotation_entry(Proto proto) throws RecognitionException {
        ProtoParser.annotation_entry_return retval = new ProtoParser.annotation_entry_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token AT13=null;
        Token LEFTPAREN15=null;
        Token COMMA17=null;
        Token RIGHTPAREN19=null;
        ProtoParser.var_return var14 = null;

        ProtoParser.annotation_keyval_return annotation_keyval16 = null;

        ProtoParser.annotation_keyval_return annotation_keyval18 = null;


        Object AT13_tree=null;
        Object LEFTPAREN15_tree=null;
        Object COMMA17_tree=null;
        Object RIGHTPAREN19_tree=null;


            Annotation annotation = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:86:5: ( AT var ( LEFTPAREN annotation_keyval[proto, annotation] ( COMMA annotation_keyval[proto, annotation] )* RIGHTPAREN )? )
            // com/dyuproject/protostuff/parser/ProtoParser.g:86:9: AT var ( LEFTPAREN annotation_keyval[proto, annotation] ( COMMA annotation_keyval[proto, annotation] )* RIGHTPAREN )?
            {
            root_0 = (Object)adaptor.nil();

            AT13=(Token)match(input,AT,FOLLOW_AT_in_annotation_entry519); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            AT13_tree = (Object)adaptor.create(AT13);
            adaptor.addChild(root_0, AT13_tree);
            }
            pushFollow(FOLLOW_var_in_annotation_entry521);
            var14=var();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, var14.getTree());
            if ( state.backtracking==0 ) {
               annotation = new Annotation((var14!=null?input.toString(var14.start,var14.stop):null)); 
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:87:9: ( LEFTPAREN annotation_keyval[proto, annotation] ( COMMA annotation_keyval[proto, annotation] )* RIGHTPAREN )?
            int alt4=2;
            switch ( input.LA(1) ) {
                case LEFTPAREN:
                    {
                    alt4=1;
                    }
                    break;
            }

            switch (alt4) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:87:10: LEFTPAREN annotation_keyval[proto, annotation] ( COMMA annotation_keyval[proto, annotation] )* RIGHTPAREN
                    {
                    LEFTPAREN15=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_annotation_entry534); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    LEFTPAREN15_tree = (Object)adaptor.create(LEFTPAREN15);
                    adaptor.addChild(root_0, LEFTPAREN15_tree);
                    }
                    pushFollow(FOLLOW_annotation_keyval_in_annotation_entry545);
                    annotation_keyval16=annotation_keyval(proto, annotation);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_keyval16.getTree());
                    // com/dyuproject/protostuff/parser/ProtoParser.g:88:46: ( COMMA annotation_keyval[proto, annotation] )*
                    loop3:
                    do {
                        int alt3=2;
                        switch ( input.LA(1) ) {
                        case COMMA:
                            {
                            alt3=1;
                            }
                            break;

                        }

                        switch (alt3) {
                    	case 1 :
                    	    // com/dyuproject/protostuff/parser/ProtoParser.g:88:47: COMMA annotation_keyval[proto, annotation]
                    	    {
                    	    COMMA17=(Token)match(input,COMMA,FOLLOW_COMMA_in_annotation_entry549); if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) {
                    	    COMMA17_tree = (Object)adaptor.create(COMMA17);
                    	    adaptor.addChild(root_0, COMMA17_tree);
                    	    }
                    	    pushFollow(FOLLOW_annotation_keyval_in_annotation_entry551);
                    	    annotation_keyval18=annotation_keyval(proto, annotation);

                    	    state._fsp--;
                    	    if (state.failed) return retval;
                    	    if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_keyval18.getTree());

                    	    }
                    	    break;

                    	default :
                    	    break loop3;
                        }
                    } while (true);

                    RIGHTPAREN19=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_annotation_entry565); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    RIGHTPAREN19_tree = (Object)adaptor.create(RIGHTPAREN19);
                    adaptor.addChild(root_0, RIGHTPAREN19_tree);
                    }

                    }
                    break;

            }

            if ( state.backtracking==0 ) {

                          proto.add(annotation);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "annotation_entry"

    public static class annotation_keyval_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "annotation_keyval"
    // com/dyuproject/protostuff/parser/ProtoParser.g:94:1: annotation_keyval[Proto proto, Annotation annotation] : k= var ASSIGN (v= var | NUMFLOAT | NUMINT | NUMDOUBLE | TRUE | FALSE | STRING_LITERAL ) ;
    public final ProtoParser.annotation_keyval_return annotation_keyval(Proto proto, Annotation annotation) throws RecognitionException {
        ProtoParser.annotation_keyval_return retval = new ProtoParser.annotation_keyval_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token ASSIGN20=null;
        Token NUMFLOAT21=null;
        Token NUMINT22=null;
        Token NUMDOUBLE23=null;
        Token TRUE24=null;
        Token FALSE25=null;
        Token STRING_LITERAL26=null;
        ProtoParser.var_return k = null;

        ProtoParser.var_return v = null;


        Object ASSIGN20_tree=null;
        Object NUMFLOAT21_tree=null;
        Object NUMINT22_tree=null;
        Object NUMDOUBLE23_tree=null;
        Object TRUE24_tree=null;
        Object FALSE25_tree=null;
        Object STRING_LITERAL26_tree=null;


            Object value = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:98:5: (k= var ASSIGN (v= var | NUMFLOAT | NUMINT | NUMDOUBLE | TRUE | FALSE | STRING_LITERAL ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:98:9: k= var ASSIGN (v= var | NUMFLOAT | NUMINT | NUMDOUBLE | TRUE | FALSE | STRING_LITERAL )
            {
            root_0 = (Object)adaptor.nil();

            pushFollow(FOLLOW_var_in_annotation_keyval597);
            k=var();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, k.getTree());
            ASSIGN20=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_annotation_keyval599); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN20_tree = (Object)adaptor.create(ASSIGN20);
            adaptor.addChild(root_0, ASSIGN20_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:98:22: (v= var | NUMFLOAT | NUMINT | NUMDOUBLE | TRUE | FALSE | STRING_LITERAL )
            int alt5=7;
            switch ( input.LA(1) ) {
            case TO:
            case PKG:
            case SYNTAX:
            case IMPORT:
            case MESSAGE:
            case SERVICE:
            case ENUM:
            case REQUIRED:
            case OPTIONAL:
            case REPEATED:
            case EXTENSIONS:
            case EXTEND:
            case GROUP:
            case RPC:
            case RETURNS:
            case INT32:
            case INT64:
            case UINT32:
            case UINT64:
            case SINT32:
            case SINT64:
            case FIXED32:
            case FIXED64:
            case SFIXED32:
            case SFIXED64:
            case FLOAT:
            case DOUBLE:
            case BOOL:
            case STRING:
            case BYTES:
            case DEFAULT:
            case MAX:
            case VOID:
            case ID:
            case OPTIONS:
                {
                alt5=1;
                }
                break;
            case NUMFLOAT:
                {
                alt5=2;
                }
                break;
            case NUMINT:
                {
                alt5=3;
                }
                break;
            case NUMDOUBLE:
                {
                alt5=4;
                }
                break;
            case TRUE:
                {
                alt5=5;
                }
                break;
            case FALSE:
                {
                alt5=6;
                }
                break;
            case STRING_LITERAL:
                {
                alt5=7;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;
            }

            switch (alt5) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:99:13: v= var
                    {
                    pushFollow(FOLLOW_var_in_annotation_keyval617);
                    v=var();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, v.getTree());
                    if ( state.backtracking==0 ) {
                       value = (v!=null?input.toString(v.start,v.stop):null); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:100:17: NUMFLOAT
                    {
                    NUMFLOAT21=(Token)match(input,NUMFLOAT,FOLLOW_NUMFLOAT_in_annotation_keyval637); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMFLOAT21_tree = (Object)adaptor.create(NUMFLOAT21);
                    adaptor.addChild(root_0, NUMFLOAT21_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Float.valueOf((NUMFLOAT21!=null?NUMFLOAT21.getText():null)); 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:101:17: NUMINT
                    {
                    NUMINT22=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_annotation_keyval657); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMINT22_tree = (Object)adaptor.create(NUMINT22);
                    adaptor.addChild(root_0, NUMINT22_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Integer.valueOf((NUMINT22!=null?NUMINT22.getText():null)); 
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:102:17: NUMDOUBLE
                    {
                    NUMDOUBLE23=(Token)match(input,NUMDOUBLE,FOLLOW_NUMDOUBLE_in_annotation_keyval677); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMDOUBLE23_tree = (Object)adaptor.create(NUMDOUBLE23);
                    adaptor.addChild(root_0, NUMDOUBLE23_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Double.valueOf((NUMDOUBLE23!=null?NUMDOUBLE23.getText():null)); 
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:103:17: TRUE
                    {
                    TRUE24=(Token)match(input,TRUE,FOLLOW_TRUE_in_annotation_keyval697); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TRUE24_tree = (Object)adaptor.create(TRUE24);
                    adaptor.addChild(root_0, TRUE24_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Boolean.TRUE; 
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:104:17: FALSE
                    {
                    FALSE25=(Token)match(input,FALSE,FOLLOW_FALSE_in_annotation_keyval717); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FALSE25_tree = (Object)adaptor.create(FALSE25);
                    adaptor.addChild(root_0, FALSE25_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Boolean.FALSE; 
                    }

                    }
                    break;
                case 7 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:105:17: STRING_LITERAL
                    {
                    STRING_LITERAL26=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_annotation_keyval737); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING_LITERAL26_tree = (Object)adaptor.create(STRING_LITERAL26);
                    adaptor.addChild(root_0, STRING_LITERAL26_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = getStringFromStringLiteral((STRING_LITERAL26!=null?STRING_LITERAL26.getText():null)); 
                    }

                    }
                    break;

            }

            if ( state.backtracking==0 ) {

                          annotation.put((k!=null?input.toString(k.start,k.stop):null), value);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "annotation_keyval"

    public static class header_syntax_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "header_syntax"
    // com/dyuproject/protostuff/parser/ProtoParser.g:111:1: header_syntax[Proto proto] : SYNTAX ASSIGN STRING_LITERAL SEMICOLON ;
    public final ProtoParser.header_syntax_return header_syntax(Proto proto) throws RecognitionException {
        ProtoParser.header_syntax_return retval = new ProtoParser.header_syntax_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token SYNTAX27=null;
        Token ASSIGN28=null;
        Token STRING_LITERAL29=null;
        Token SEMICOLON30=null;

        Object SYNTAX27_tree=null;
        Object ASSIGN28_tree=null;
        Object STRING_LITERAL29_tree=null;
        Object SEMICOLON30_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:112:5: ( SYNTAX ASSIGN STRING_LITERAL SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:112:9: SYNTAX ASSIGN STRING_LITERAL SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            SYNTAX27=(Token)match(input,SYNTAX,FOLLOW_SYNTAX_in_header_syntax772); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            SYNTAX27_tree = (Object)adaptor.create(SYNTAX27);
            adaptor.addChild(root_0, SYNTAX27_tree);
            }
            ASSIGN28=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_header_syntax774); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN28_tree = (Object)adaptor.create(ASSIGN28);
            adaptor.addChild(root_0, ASSIGN28_tree);
            }
            STRING_LITERAL29=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_header_syntax776); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            STRING_LITERAL29_tree = (Object)adaptor.create(STRING_LITERAL29);
            adaptor.addChild(root_0, STRING_LITERAL29_tree);
            }
            SEMICOLON30=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_header_syntax778); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(!"proto2".equals(getStringFromStringLiteral((STRING_LITERAL29!=null?STRING_LITERAL29.getText():null)))) {
                              throw new IllegalStateException("Syntax isn't proto2: '" +
                                getStringFromStringLiteral((STRING_LITERAL29!=null?STRING_LITERAL29.getText():null))+"'");
                          }
                                
                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "header_syntax"

    public static class header_package_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "header_package"
    // com/dyuproject/protostuff/parser/ProtoParser.g:123:1: header_package[Proto proto] : PKG ( FULL_ID | var ) SEMICOLON ;
    public final ProtoParser.header_package_return header_package(Proto proto) throws RecognitionException {
        ProtoParser.header_package_return retval = new ProtoParser.header_package_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token PKG31=null;
        Token FULL_ID32=null;
        Token SEMICOLON34=null;
        ProtoParser.var_return var33 = null;


        Object PKG31_tree=null;
        Object FULL_ID32_tree=null;
        Object SEMICOLON34_tree=null;


            String value = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:127:5: ( PKG ( FULL_ID | var ) SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:127:9: PKG ( FULL_ID | var ) SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            PKG31=(Token)match(input,PKG,FOLLOW_PKG_in_header_package807); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            PKG31_tree = (Object)adaptor.create(PKG31);
            adaptor.addChild(root_0, PKG31_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:127:13: ( FULL_ID | var )
            int alt6=2;
            switch ( input.LA(1) ) {
            case FULL_ID:
                {
                alt6=1;
                }
                break;
            case TO:
            case PKG:
            case SYNTAX:
            case IMPORT:
            case MESSAGE:
            case SERVICE:
            case ENUM:
            case REQUIRED:
            case OPTIONAL:
            case REPEATED:
            case EXTENSIONS:
            case EXTEND:
            case GROUP:
            case RPC:
            case RETURNS:
            case INT32:
            case INT64:
            case UINT32:
            case UINT64:
            case SINT32:
            case SINT64:
            case FIXED32:
            case FIXED64:
            case SFIXED32:
            case SFIXED64:
            case FLOAT:
            case DOUBLE:
            case BOOL:
            case STRING:
            case BYTES:
            case DEFAULT:
            case MAX:
            case VOID:
            case ID:
            case OPTIONS:
                {
                alt6=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 6, 0, input);

                throw nvae;
            }

            switch (alt6) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:127:14: FULL_ID
                    {
                    FULL_ID32=(Token)match(input,FULL_ID,FOLLOW_FULL_ID_in_header_package810); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FULL_ID32_tree = (Object)adaptor.create(FULL_ID32);
                    adaptor.addChild(root_0, FULL_ID32_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = (FULL_ID32!=null?FULL_ID32.getText():null); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:127:51: var
                    {
                    pushFollow(FOLLOW_var_in_header_package816);
                    var33=var();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, var33.getTree());
                    if ( state.backtracking==0 ) {
                       value = (var33!=null?input.toString(var33.start,var33.stop):null); 
                    }

                    }
                    break;

            }

            SEMICOLON34=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_header_package821); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(proto.getPackageName() != null)
                              throw new IllegalStateException("Multiple package definitions.");
                          
                          proto.setPackageName(value);
                          
                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "header_package"

    public static class header_import_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "header_import"
    // com/dyuproject/protostuff/parser/ProtoParser.g:138:1: header_import[Proto proto] : IMPORT STRING_LITERAL SEMICOLON ;
    public final ProtoParser.header_import_return header_import(Proto proto) throws RecognitionException {
        ProtoParser.header_import_return retval = new ProtoParser.header_import_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token IMPORT35=null;
        Token STRING_LITERAL36=null;
        Token SEMICOLON37=null;

        Object IMPORT35_tree=null;
        Object STRING_LITERAL36_tree=null;
        Object SEMICOLON37_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:139:5: ( IMPORT STRING_LITERAL SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:139:9: IMPORT STRING_LITERAL SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            IMPORT35=(Token)match(input,IMPORT,FOLLOW_IMPORT_in_header_import849); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            IMPORT35_tree = (Object)adaptor.create(IMPORT35);
            adaptor.addChild(root_0, IMPORT35_tree);
            }
            STRING_LITERAL36=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_header_import851); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            STRING_LITERAL36_tree = (Object)adaptor.create(STRING_LITERAL36);
            adaptor.addChild(root_0, STRING_LITERAL36_tree);
            }
            SEMICOLON37=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_header_import853); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          proto.importProto(getStringFromStringLiteral((STRING_LITERAL36!=null?STRING_LITERAL36.getText():null)));
                          
                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "header_import"

    public static class header_option_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "header_option"
    // com/dyuproject/protostuff/parser/ProtoParser.g:147:1: header_option[Proto proto] : OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON ;
    public final ProtoParser.header_option_return header_option(Proto proto) throws RecognitionException {
        ProtoParser.header_option_return retval = new ProtoParser.header_option_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token n=null;
        Token v=null;
        Token OPTION38=null;
        Token LEFTPAREN39=null;
        Token RIGHTPAREN40=null;
        Token ASSIGN41=null;
        Token STRING_LITERAL42=null;
        Token TRUE43=null;
        Token FALSE44=null;
        Token NUMINT45=null;
        Token NUMFLOAT46=null;
        Token SEMICOLON47=null;

        Object n_tree=null;
        Object v_tree=null;
        Object OPTION38_tree=null;
        Object LEFTPAREN39_tree=null;
        Object RIGHTPAREN40_tree=null;
        Object ASSIGN41_tree=null;
        Object STRING_LITERAL42_tree=null;
        Object TRUE43_tree=null;
        Object FALSE44_tree=null;
        Object NUMINT45_tree=null;
        Object NUMFLOAT46_tree=null;
        Object SEMICOLON47_tree=null;


            boolean standard = false;
            String value = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:152:5: ( OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:152:9: OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            OPTION38=(Token)match(input,OPTION,FOLLOW_OPTION_in_header_option882); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            OPTION38_tree = (Object)adaptor.create(OPTION38);
            adaptor.addChild(root_0, OPTION38_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:152:16: ( LEFTPAREN )?
            int alt7=2;
            switch ( input.LA(1) ) {
                case LEFTPAREN:
                    {
                    alt7=1;
                    }
                    break;
            }

            switch (alt7) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:152:16: LEFTPAREN
                    {
                    LEFTPAREN39=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_header_option884); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    LEFTPAREN39_tree = (Object)adaptor.create(LEFTPAREN39);
                    adaptor.addChild(root_0, LEFTPAREN39_tree);
                    }

                    }
                    break;

            }

            n=(Token)input.LT(1);
            if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(n));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }

            // com/dyuproject/protostuff/parser/ProtoParser.g:152:42: ( RIGHTPAREN )?
            int alt8=2;
            switch ( input.LA(1) ) {
                case RIGHTPAREN:
                    {
                    alt8=1;
                    }
                    break;
            }

            switch (alt8) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:152:42: RIGHTPAREN
                    {
                    RIGHTPAREN40=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_header_option895); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    RIGHTPAREN40_tree = (Object)adaptor.create(RIGHTPAREN40);
                    adaptor.addChild(root_0, RIGHTPAREN40_tree);
                    }

                    }
                    break;

            }

            ASSIGN41=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_header_option898); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN41_tree = (Object)adaptor.create(ASSIGN41);
            adaptor.addChild(root_0, ASSIGN41_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:152:61: (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT )
            int alt9=6;
            switch ( input.LA(1) ) {
            case ID:
            case FULL_ID:
                {
                alt9=1;
                }
                break;
            case STRING_LITERAL:
                {
                alt9=2;
                }
                break;
            case TRUE:
                {
                alt9=3;
                }
                break;
            case FALSE:
                {
                alt9=4;
                }
                break;
            case NUMINT:
                {
                alt9=5;
                }
                break;
            case NUMFLOAT:
                {
                alt9=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 9, 0, input);

                throw nvae;
            }

            switch (alt9) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:153:13: v= ( ID | FULL_ID )
                    {
                    v=(Token)input.LT(1);
                    if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(v));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    if ( state.backtracking==0 ) {
                       standard = true; value = (v!=null?v.getText():null); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:154:15: STRING_LITERAL
                    {
                    STRING_LITERAL42=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_header_option939); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING_LITERAL42_tree = (Object)adaptor.create(STRING_LITERAL42);
                    adaptor.addChild(root_0, STRING_LITERAL42_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = getStringFromStringLiteral((STRING_LITERAL42!=null?STRING_LITERAL42.getText():null)); 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:155:15: TRUE
                    {
                    TRUE43=(Token)match(input,TRUE,FOLLOW_TRUE_in_header_option957); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TRUE43_tree = (Object)adaptor.create(TRUE43);
                    adaptor.addChild(root_0, TRUE43_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "true"; 
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:156:15: FALSE
                    {
                    FALSE44=(Token)match(input,FALSE,FOLLOW_FALSE_in_header_option975); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FALSE44_tree = (Object)adaptor.create(FALSE44);
                    adaptor.addChild(root_0, FALSE44_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "false"; 
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:157:15: NUMINT
                    {
                    NUMINT45=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_header_option993); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMINT45_tree = (Object)adaptor.create(NUMINT45);
                    adaptor.addChild(root_0, NUMINT45_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = (NUMINT45!=null?NUMINT45.getText():null); 
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:158:15: NUMFLOAT
                    {
                    NUMFLOAT46=(Token)match(input,NUMFLOAT,FOLLOW_NUMFLOAT_in_header_option1011); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMFLOAT46_tree = (Object)adaptor.create(NUMFLOAT46);
                    adaptor.addChild(root_0, NUMFLOAT46_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Float.valueOf((NUMFLOAT46!=null?NUMFLOAT46.getText():null)).toString(); 
                    }

                    }
                    break;

            }

            SEMICOLON47=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_header_option1025); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(standard)
                              proto.putStandardOption((n!=null?n.getText():null), value);
                          else
                              proto.putExtraOption((n!=null?n.getText():null), value);
                              
                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "header_option"

    public static class message_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "message_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:170:1: message_block[Proto proto, Message parent] : MESSAGE ID LEFTCURLY ( message_body[proto, message] )* RIGHTCURLY ;
    public final ProtoParser.message_block_return message_block(Proto proto, Message parent) throws RecognitionException {
        ProtoParser.message_block_return retval = new ProtoParser.message_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token MESSAGE48=null;
        Token ID49=null;
        Token LEFTCURLY50=null;
        Token RIGHTCURLY52=null;
        ProtoParser.message_body_return message_body51 = null;


        Object MESSAGE48_tree=null;
        Object ID49_tree=null;
        Object LEFTCURLY50_tree=null;
        Object RIGHTCURLY52_tree=null;


            Message message = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:174:5: ( MESSAGE ID LEFTCURLY ( message_body[proto, message] )* RIGHTCURLY )
            // com/dyuproject/protostuff/parser/ProtoParser.g:174:9: MESSAGE ID LEFTCURLY ( message_body[proto, message] )* RIGHTCURLY
            {
            root_0 = (Object)adaptor.nil();

            MESSAGE48=(Token)match(input,MESSAGE,FOLLOW_MESSAGE_in_message_block1058); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            MESSAGE48_tree = (Object)adaptor.create(MESSAGE48);
            adaptor.addChild(root_0, MESSAGE48_tree);
            }
            ID49=(Token)match(input,ID,FOLLOW_ID_in_message_block1060); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ID49_tree = (Object)adaptor.create(ID49);
            adaptor.addChild(root_0, ID49_tree);
            }
            if ( state.backtracking==0 ) {
               
                          message = new Message((ID49!=null?ID49.getText():null));
                          if(parent==null)
                              proto.addMessage(message);
                          else
                              parent.addNestedMessage(message);
                              
                          message.addAnnotations(proto.annotations, true);
                      
            }
            LEFTCURLY50=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_message_block1073); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY50_tree = (Object)adaptor.create(LEFTCURLY50);
            adaptor.addChild(root_0, LEFTCURLY50_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:183:19: ( message_body[proto, message] )*
            loop10:
            do {
                int alt10=2;
                switch ( input.LA(1) ) {
                case AT:
                case OPTION:
                case MESSAGE:
                case ENUM:
                case REQUIRED:
                case OPTIONAL:
                case REPEATED:
                case EXTENSIONS:
                case EXTEND:
                    {
                    alt10=1;
                    }
                    break;

                }

                switch (alt10) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:183:20: message_body[proto, message]
            	    {
            	    pushFollow(FOLLOW_message_body_in_message_block1076);
            	    message_body51=message_body(proto, message);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, message_body51.getTree());

            	    }
            	    break;

            	default :
            	    break loop10;
                }
            } while (true);

            RIGHTCURLY52=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_message_block1081); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY52_tree = (Object)adaptor.create(RIGHTCURLY52);
            adaptor.addChild(root_0, RIGHTCURLY52_tree);
            }
            if ( state.backtracking==0 ) {

                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "message_block"

    public static class message_body_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "message_body"
    // com/dyuproject/protostuff/parser/ProtoParser.g:189:1: message_body[Proto proto, Message message] : ( message_block[proto, message] | message_field[proto, message] | enum_block[proto, message] | extend_block[proto, message] | extensions_range[proto, message] | annotation_entry[proto] | message_option[proto, message] );
    public final ProtoParser.message_body_return message_body(Proto proto, Message message) throws RecognitionException {
        ProtoParser.message_body_return retval = new ProtoParser.message_body_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        ProtoParser.message_block_return message_block53 = null;

        ProtoParser.message_field_return message_field54 = null;

        ProtoParser.enum_block_return enum_block55 = null;

        ProtoParser.extend_block_return extend_block56 = null;

        ProtoParser.extensions_range_return extensions_range57 = null;

        ProtoParser.annotation_entry_return annotation_entry58 = null;

        ProtoParser.message_option_return message_option59 = null;



        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:190:5: ( message_block[proto, message] | message_field[proto, message] | enum_block[proto, message] | extend_block[proto, message] | extensions_range[proto, message] | annotation_entry[proto] | message_option[proto, message] )
            int alt11=7;
            switch ( input.LA(1) ) {
            case MESSAGE:
                {
                alt11=1;
                }
                break;
            case REQUIRED:
            case OPTIONAL:
            case REPEATED:
                {
                alt11=2;
                }
                break;
            case ENUM:
                {
                alt11=3;
                }
                break;
            case EXTEND:
                {
                alt11=4;
                }
                break;
            case EXTENSIONS:
                {
                alt11=5;
                }
                break;
            case AT:
                {
                alt11=6;
                }
                break;
            case OPTION:
                {
                alt11=7;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 11, 0, input);

                throw nvae;
            }

            switch (alt11) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:190:9: message_block[proto, message]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_message_block_in_message_body1104);
                    message_block53=message_block(proto, message);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, message_block53.getTree());

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:191:9: message_field[proto, message]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_message_field_in_message_body1115);
                    message_field54=message_field(proto, message);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, message_field54.getTree());

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:192:9: enum_block[proto, message]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_enum_block_in_message_body1126);
                    enum_block55=enum_block(proto, message);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_block55.getTree());

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:193:9: extend_block[proto, message]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_extend_block_in_message_body1137);
                    extend_block56=extend_block(proto, message);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, extend_block56.getTree());

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:194:9: extensions_range[proto, message]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_extensions_range_in_message_body1148);
                    extensions_range57=extensions_range(proto, message);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, extensions_range57.getTree());

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:195:9: annotation_entry[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_annotation_entry_in_message_body1159);
                    annotation_entry58=annotation_entry(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_entry58.getTree());

                    }
                    break;
                case 7 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:196:9: message_option[proto, message]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_message_option_in_message_body1170);
                    message_option59=message_option(proto, message);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, message_option59.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "message_body"

    public static class message_option_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "message_option"
    // com/dyuproject/protostuff/parser/ProtoParser.g:199:1: message_option[Proto proto, HasFields message] : OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON ;
    public final ProtoParser.message_option_return message_option(Proto proto, HasFields message) throws RecognitionException {
        ProtoParser.message_option_return retval = new ProtoParser.message_option_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token n=null;
        Token v=null;
        Token OPTION60=null;
        Token LEFTPAREN61=null;
        Token RIGHTPAREN62=null;
        Token ASSIGN63=null;
        Token STRING_LITERAL64=null;
        Token TRUE65=null;
        Token FALSE66=null;
        Token NUMINT67=null;
        Token NUMFLOAT68=null;
        Token SEMICOLON69=null;

        Object n_tree=null;
        Object v_tree=null;
        Object OPTION60_tree=null;
        Object LEFTPAREN61_tree=null;
        Object RIGHTPAREN62_tree=null;
        Object ASSIGN63_tree=null;
        Object STRING_LITERAL64_tree=null;
        Object TRUE65_tree=null;
        Object FALSE66_tree=null;
        Object NUMINT67_tree=null;
        Object NUMFLOAT68_tree=null;
        Object SEMICOLON69_tree=null;


            boolean standard = false;
            String value = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:204:5: ( OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:204:9: OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            OPTION60=(Token)match(input,OPTION,FOLLOW_OPTION_in_message_option1201); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            OPTION60_tree = (Object)adaptor.create(OPTION60);
            adaptor.addChild(root_0, OPTION60_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:204:16: ( LEFTPAREN )?
            int alt12=2;
            switch ( input.LA(1) ) {
                case LEFTPAREN:
                    {
                    alt12=1;
                    }
                    break;
            }

            switch (alt12) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:204:16: LEFTPAREN
                    {
                    LEFTPAREN61=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_message_option1203); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    LEFTPAREN61_tree = (Object)adaptor.create(LEFTPAREN61);
                    adaptor.addChild(root_0, LEFTPAREN61_tree);
                    }

                    }
                    break;

            }

            n=(Token)input.LT(1);
            if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(n));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }

            // com/dyuproject/protostuff/parser/ProtoParser.g:204:42: ( RIGHTPAREN )?
            int alt13=2;
            switch ( input.LA(1) ) {
                case RIGHTPAREN:
                    {
                    alt13=1;
                    }
                    break;
            }

            switch (alt13) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:204:42: RIGHTPAREN
                    {
                    RIGHTPAREN62=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_message_option1214); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    RIGHTPAREN62_tree = (Object)adaptor.create(RIGHTPAREN62);
                    adaptor.addChild(root_0, RIGHTPAREN62_tree);
                    }

                    }
                    break;

            }

            ASSIGN63=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_message_option1217); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN63_tree = (Object)adaptor.create(ASSIGN63);
            adaptor.addChild(root_0, ASSIGN63_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:204:61: (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT )
            int alt14=6;
            switch ( input.LA(1) ) {
            case ID:
            case FULL_ID:
                {
                alt14=1;
                }
                break;
            case STRING_LITERAL:
                {
                alt14=2;
                }
                break;
            case TRUE:
                {
                alt14=3;
                }
                break;
            case FALSE:
                {
                alt14=4;
                }
                break;
            case NUMINT:
                {
                alt14=5;
                }
                break;
            case NUMFLOAT:
                {
                alt14=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 14, 0, input);

                throw nvae;
            }

            switch (alt14) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:205:13: v= ( ID | FULL_ID )
                    {
                    v=(Token)input.LT(1);
                    if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(v));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    if ( state.backtracking==0 ) {
                       standard = true; value = (v!=null?v.getText():null); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:206:15: STRING_LITERAL
                    {
                    STRING_LITERAL64=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_message_option1258); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING_LITERAL64_tree = (Object)adaptor.create(STRING_LITERAL64);
                    adaptor.addChild(root_0, STRING_LITERAL64_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = getStringFromStringLiteral((STRING_LITERAL64!=null?STRING_LITERAL64.getText():null)); 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:207:15: TRUE
                    {
                    TRUE65=(Token)match(input,TRUE,FOLLOW_TRUE_in_message_option1276); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TRUE65_tree = (Object)adaptor.create(TRUE65);
                    adaptor.addChild(root_0, TRUE65_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "true"; 
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:208:15: FALSE
                    {
                    FALSE66=(Token)match(input,FALSE,FOLLOW_FALSE_in_message_option1294); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FALSE66_tree = (Object)adaptor.create(FALSE66);
                    adaptor.addChild(root_0, FALSE66_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "false"; 
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:209:15: NUMINT
                    {
                    NUMINT67=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_message_option1312); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMINT67_tree = (Object)adaptor.create(NUMINT67);
                    adaptor.addChild(root_0, NUMINT67_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = (NUMINT67!=null?NUMINT67.getText():null); 
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:210:15: NUMFLOAT
                    {
                    NUMFLOAT68=(Token)match(input,NUMFLOAT,FOLLOW_NUMFLOAT_in_message_option1330); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMFLOAT68_tree = (Object)adaptor.create(NUMFLOAT68);
                    adaptor.addChild(root_0, NUMFLOAT68_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Float.valueOf((NUMFLOAT68!=null?NUMFLOAT68.getText():null)).toString(); 
                    }

                    }
                    break;

            }

            SEMICOLON69=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_message_option1344); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(standard)
                              message.putStandardOption((n!=null?n.getText():null), value);
                          else
                              message.putExtraOption((n!=null?n.getText():null), value);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "message_option"

    public static class extensions_range_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "extensions_range"
    // com/dyuproject/protostuff/parser/ProtoParser.g:219:1: extensions_range[Proto proto, Message message] : EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON ;
    public final ProtoParser.extensions_range_return extensions_range(Proto proto, Message message) throws RecognitionException {
        ProtoParser.extensions_range_return retval = new ProtoParser.extensions_range_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token f=null;
        Token l=null;
        Token EXTENSIONS70=null;
        Token TO71=null;
        Token MAX72=null;
        Token SEMICOLON73=null;

        Object f_tree=null;
        Object l_tree=null;
        Object EXTENSIONS70_tree=null;
        Object TO71_tree=null;
        Object MAX72_tree=null;
        Object SEMICOLON73_tree=null;


          int first = -1;
          int last = -1;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:224:5: ( EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:224:9: EXTENSIONS f= NUMINT ( TO (l= NUMINT | MAX ) )? SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            EXTENSIONS70=(Token)match(input,EXTENSIONS,FOLLOW_EXTENSIONS_in_extensions_range1377); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            EXTENSIONS70_tree = (Object)adaptor.create(EXTENSIONS70);
            adaptor.addChild(root_0, EXTENSIONS70_tree);
            }
            f=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_extensions_range1381); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            f_tree = (Object)adaptor.create(f);
            adaptor.addChild(root_0, f_tree);
            }
            if ( state.backtracking==0 ) {
               first = Integer.parseInt((f!=null?f.getText():null)); last = first;
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:225:9: ( TO (l= NUMINT | MAX ) )?
            int alt16=2;
            switch ( input.LA(1) ) {
                case TO:
                    {
                    alt16=1;
                    }
                    break;
            }

            switch (alt16) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:225:11: TO (l= NUMINT | MAX )
                    {
                    TO71=(Token)match(input,TO,FOLLOW_TO_in_extensions_range1395); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TO71_tree = (Object)adaptor.create(TO71);
                    adaptor.addChild(root_0, TO71_tree);
                    }
                    // com/dyuproject/protostuff/parser/ProtoParser.g:225:14: (l= NUMINT | MAX )
                    int alt15=2;
                    switch ( input.LA(1) ) {
                    case NUMINT:
                        {
                        alt15=1;
                        }
                        break;
                    case MAX:
                        {
                        alt15=2;
                        }
                        break;
                    default:
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        NoViableAltException nvae =
                            new NoViableAltException("", 15, 0, input);

                        throw nvae;
                    }

                    switch (alt15) {
                        case 1 :
                            // com/dyuproject/protostuff/parser/ProtoParser.g:225:16: l= NUMINT
                            {
                            l=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_extensions_range1401); if (state.failed) return retval;
                            if ( state.backtracking==0 ) {
                            l_tree = (Object)adaptor.create(l);
                            adaptor.addChild(root_0, l_tree);
                            }
                            if ( state.backtracking==0 ) {
                               last = Integer.parseInt((l!=null?l.getText():null)); 
                            }

                            }
                            break;
                        case 2 :
                            // com/dyuproject/protostuff/parser/ProtoParser.g:225:65: MAX
                            {
                            MAX72=(Token)match(input,MAX,FOLLOW_MAX_in_extensions_range1407); if (state.failed) return retval;
                            if ( state.backtracking==0 ) {
                            MAX72_tree = (Object)adaptor.create(MAX72);
                            adaptor.addChild(root_0, MAX72_tree);
                            }
                            if ( state.backtracking==0 ) {
                              last = 536870911; 
                            }

                            }
                            break;

                    }


                    }
                    break;

            }

            SEMICOLON73=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_extensions_range1424); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          message.defineExtensionRange(first, last);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "extensions_range"

    public static class message_field_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "message_field"
    // com/dyuproject/protostuff/parser/ProtoParser.g:231:1: message_field[Proto proto, HasFields message] : ( OPTIONAL | REQUIRED | REPEATED ) field_type[proto, message, fieldHolder] var ASSIGN NUMINT ( field_options[proto, message, fieldHolder.field] )? ( SEMICOLON | ignore_block ) ;
    public final ProtoParser.message_field_return message_field(Proto proto, HasFields message) throws RecognitionException {
        ProtoParser.message_field_return retval = new ProtoParser.message_field_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token OPTIONAL74=null;
        Token REQUIRED75=null;
        Token REPEATED76=null;
        Token ASSIGN79=null;
        Token NUMINT80=null;
        Token SEMICOLON82=null;
        ProtoParser.field_type_return field_type77 = null;

        ProtoParser.var_return var78 = null;

        ProtoParser.field_options_return field_options81 = null;

        ProtoParser.ignore_block_return ignore_block83 = null;


        Object OPTIONAL74_tree=null;
        Object REQUIRED75_tree=null;
        Object REPEATED76_tree=null;
        Object ASSIGN79_tree=null;
        Object NUMINT80_tree=null;
        Object SEMICOLON82_tree=null;


            Field.Modifier modifier = null;
            FieldHolder fieldHolder = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:236:5: ( ( OPTIONAL | REQUIRED | REPEATED ) field_type[proto, message, fieldHolder] var ASSIGN NUMINT ( field_options[proto, message, fieldHolder.field] )? ( SEMICOLON | ignore_block ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:236:9: ( OPTIONAL | REQUIRED | REPEATED ) field_type[proto, message, fieldHolder] var ASSIGN NUMINT ( field_options[proto, message, fieldHolder.field] )? ( SEMICOLON | ignore_block )
            {
            root_0 = (Object)adaptor.nil();

            // com/dyuproject/protostuff/parser/ProtoParser.g:236:9: ( OPTIONAL | REQUIRED | REPEATED )
            int alt17=3;
            switch ( input.LA(1) ) {
            case OPTIONAL:
                {
                alt17=1;
                }
                break;
            case REQUIRED:
                {
                alt17=2;
                }
                break;
            case REPEATED:
                {
                alt17=3;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 17, 0, input);

                throw nvae;
            }

            switch (alt17) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:236:10: OPTIONAL
                    {
                    OPTIONAL74=(Token)match(input,OPTIONAL,FOLLOW_OPTIONAL_in_message_field1458); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    OPTIONAL74_tree = (Object)adaptor.create(OPTIONAL74);
                    adaptor.addChild(root_0, OPTIONAL74_tree);
                    }
                    if ( state.backtracking==0 ) {
                       modifier = Field.Modifier.OPTIONAL;  
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:237:13: REQUIRED
                    {
                    REQUIRED75=(Token)match(input,REQUIRED,FOLLOW_REQUIRED_in_message_field1475); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    REQUIRED75_tree = (Object)adaptor.create(REQUIRED75);
                    adaptor.addChild(root_0, REQUIRED75_tree);
                    }
                    if ( state.backtracking==0 ) {
                       modifier = Field.Modifier.REQUIRED; 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:238:13: REPEATED
                    {
                    REPEATED76=(Token)match(input,REPEATED,FOLLOW_REPEATED_in_message_field1492); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    REPEATED76_tree = (Object)adaptor.create(REPEATED76);
                    adaptor.addChild(root_0, REPEATED76_tree);
                    }
                    if ( state.backtracking==0 ) {
                       modifier = Field.Modifier.REPEATED; 
                    }

                    }
                    break;

            }

            if ( state.backtracking==0 ) {

                          fieldHolder = new FieldHolder();
                      
            }
            pushFollow(FOLLOW_field_type_in_message_field1507);
            field_type77=field_type(proto, message, fieldHolder);

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, field_type77.getTree());
            pushFollow(FOLLOW_var_in_message_field1519);
            var78=var();

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, var78.getTree());
            ASSIGN79=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_message_field1521); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN79_tree = (Object)adaptor.create(ASSIGN79);
            adaptor.addChild(root_0, ASSIGN79_tree);
            }
            NUMINT80=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_message_field1523); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            NUMINT80_tree = (Object)adaptor.create(NUMINT80);
            adaptor.addChild(root_0, NUMINT80_tree);
            }
            if ( state.backtracking==0 ) {

                          if(fieldHolder.field != null) {
                              fieldHolder.field.modifier = modifier;
                              fieldHolder.field.name = (var78!=null?input.toString(var78.start,var78.stop):null);
                              fieldHolder.field.number = Integer.parseInt((NUMINT80!=null?NUMINT80.getText():null));
                          }
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:249:9: ( field_options[proto, message, fieldHolder.field] )?
            int alt18=2;
            switch ( input.LA(1) ) {
                case LEFTSQUARE:
                    {
                    alt18=1;
                    }
                    break;
            }

            switch (alt18) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:249:10: field_options[proto, message, fieldHolder.field]
                    {
                    pushFollow(FOLLOW_field_options_in_message_field1537);
                    field_options81=field_options(proto, message, fieldHolder.field);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, field_options81.getTree());

                    }
                    break;

            }

            if ( state.backtracking==0 ) {

                          if(fieldHolder.field != null) {
                              fieldHolder.field.addAnnotations(proto.annotations, true);
                              message.addField(fieldHolder.field);
                          }
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:255:9: ( SEMICOLON | ignore_block )
            int alt19=2;
            switch ( input.LA(1) ) {
            case SEMICOLON:
                {
                alt19=1;
                }
                break;
            case LEFTCURLY:
                {
                alt19=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 19, 0, input);

                throw nvae;
            }

            switch (alt19) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:255:10: SEMICOLON
                    {
                    SEMICOLON82=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_message_field1553); if (state.failed) return retval;

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:255:23: ignore_block
                    {
                    pushFollow(FOLLOW_ignore_block_in_message_field1558);
                    ignore_block83=ignore_block();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, ignore_block83.getTree());

                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "message_field"

    public static class field_type_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "field_type"
    // com/dyuproject/protostuff/parser/ProtoParser.g:258:1: field_type[Proto proto, HasFields message, FieldHolder fieldHolder] : ( INT32 | UINT32 | SINT32 | FIXED32 | SFIXED32 | INT64 | UINT64 | SINT64 | FIXED64 | SFIXED64 | FLOAT | DOUBLE | BOOL | STRING | BYTES | GROUP | FULL_ID | ID );
    public final ProtoParser.field_type_return field_type(Proto proto, HasFields message, FieldHolder fieldHolder) throws RecognitionException {
        ProtoParser.field_type_return retval = new ProtoParser.field_type_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token INT3284=null;
        Token UINT3285=null;
        Token SINT3286=null;
        Token FIXED3287=null;
        Token SFIXED3288=null;
        Token INT6489=null;
        Token UINT6490=null;
        Token SINT6491=null;
        Token FIXED6492=null;
        Token SFIXED6493=null;
        Token FLOAT94=null;
        Token DOUBLE95=null;
        Token BOOL96=null;
        Token STRING97=null;
        Token BYTES98=null;
        Token GROUP99=null;
        Token FULL_ID100=null;
        Token ID101=null;

        Object INT3284_tree=null;
        Object UINT3285_tree=null;
        Object SINT3286_tree=null;
        Object FIXED3287_tree=null;
        Object SFIXED3288_tree=null;
        Object INT6489_tree=null;
        Object UINT6490_tree=null;
        Object SINT6491_tree=null;
        Object FIXED6492_tree=null;
        Object SFIXED6493_tree=null;
        Object FLOAT94_tree=null;
        Object DOUBLE95_tree=null;
        Object BOOL96_tree=null;
        Object STRING97_tree=null;
        Object BYTES98_tree=null;
        Object GROUP99_tree=null;
        Object FULL_ID100_tree=null;
        Object ID101_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:259:5: ( INT32 | UINT32 | SINT32 | FIXED32 | SFIXED32 | INT64 | UINT64 | SINT64 | FIXED64 | SFIXED64 | FLOAT | DOUBLE | BOOL | STRING | BYTES | GROUP | FULL_ID | ID )
            int alt20=18;
            switch ( input.LA(1) ) {
            case INT32:
                {
                alt20=1;
                }
                break;
            case UINT32:
                {
                alt20=2;
                }
                break;
            case SINT32:
                {
                alt20=3;
                }
                break;
            case FIXED32:
                {
                alt20=4;
                }
                break;
            case SFIXED32:
                {
                alt20=5;
                }
                break;
            case INT64:
                {
                alt20=6;
                }
                break;
            case UINT64:
                {
                alt20=7;
                }
                break;
            case SINT64:
                {
                alt20=8;
                }
                break;
            case FIXED64:
                {
                alt20=9;
                }
                break;
            case SFIXED64:
                {
                alt20=10;
                }
                break;
            case FLOAT:
                {
                alt20=11;
                }
                break;
            case DOUBLE:
                {
                alt20=12;
                }
                break;
            case BOOL:
                {
                alt20=13;
                }
                break;
            case STRING:
                {
                alt20=14;
                }
                break;
            case BYTES:
                {
                alt20=15;
                }
                break;
            case GROUP:
                {
                alt20=16;
                }
                break;
            case FULL_ID:
                {
                alt20=17;
                }
                break;
            case ID:
                {
                alt20=18;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 20, 0, input);

                throw nvae;
            }

            switch (alt20) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:259:9: INT32
                    {
                    root_0 = (Object)adaptor.nil();

                    INT3284=(Token)match(input,INT32,FOLLOW_INT32_in_field_type1584); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    INT3284_tree = (Object)adaptor.create(INT3284);
                    adaptor.addChild(root_0, INT3284_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Int32()); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:260:9: UINT32
                    {
                    root_0 = (Object)adaptor.nil();

                    UINT3285=(Token)match(input,UINT32,FOLLOW_UINT32_in_field_type1596); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    UINT3285_tree = (Object)adaptor.create(UINT3285);
                    adaptor.addChild(root_0, UINT3285_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.UInt32()); 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:261:9: SINT32
                    {
                    root_0 = (Object)adaptor.nil();

                    SINT3286=(Token)match(input,SINT32,FOLLOW_SINT32_in_field_type1608); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SINT3286_tree = (Object)adaptor.create(SINT3286);
                    adaptor.addChild(root_0, SINT3286_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.SInt32()); 
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:262:9: FIXED32
                    {
                    root_0 = (Object)adaptor.nil();

                    FIXED3287=(Token)match(input,FIXED32,FOLLOW_FIXED32_in_field_type1620); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FIXED3287_tree = (Object)adaptor.create(FIXED3287);
                    adaptor.addChild(root_0, FIXED3287_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Fixed32()); 
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:263:9: SFIXED32
                    {
                    root_0 = (Object)adaptor.nil();

                    SFIXED3288=(Token)match(input,SFIXED32,FOLLOW_SFIXED32_in_field_type1632); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SFIXED3288_tree = (Object)adaptor.create(SFIXED3288);
                    adaptor.addChild(root_0, SFIXED3288_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.SFixed32()); 
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:264:9: INT64
                    {
                    root_0 = (Object)adaptor.nil();

                    INT6489=(Token)match(input,INT64,FOLLOW_INT64_in_field_type1644); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    INT6489_tree = (Object)adaptor.create(INT6489);
                    adaptor.addChild(root_0, INT6489_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Int64()); 
                    }

                    }
                    break;
                case 7 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:265:9: UINT64
                    {
                    root_0 = (Object)adaptor.nil();

                    UINT6490=(Token)match(input,UINT64,FOLLOW_UINT64_in_field_type1656); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    UINT6490_tree = (Object)adaptor.create(UINT6490);
                    adaptor.addChild(root_0, UINT6490_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.UInt64()); 
                    }

                    }
                    break;
                case 8 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:266:9: SINT64
                    {
                    root_0 = (Object)adaptor.nil();

                    SINT6491=(Token)match(input,SINT64,FOLLOW_SINT64_in_field_type1668); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SINT6491_tree = (Object)adaptor.create(SINT6491);
                    adaptor.addChild(root_0, SINT6491_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.SInt64()); 
                    }

                    }
                    break;
                case 9 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:267:9: FIXED64
                    {
                    root_0 = (Object)adaptor.nil();

                    FIXED6492=(Token)match(input,FIXED64,FOLLOW_FIXED64_in_field_type1680); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FIXED6492_tree = (Object)adaptor.create(FIXED6492);
                    adaptor.addChild(root_0, FIXED6492_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Fixed64()); 
                    }

                    }
                    break;
                case 10 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:268:9: SFIXED64
                    {
                    root_0 = (Object)adaptor.nil();

                    SFIXED6493=(Token)match(input,SFIXED64,FOLLOW_SFIXED64_in_field_type1692); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SFIXED6493_tree = (Object)adaptor.create(SFIXED6493);
                    adaptor.addChild(root_0, SFIXED6493_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.SFixed64()); 
                    }

                    }
                    break;
                case 11 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:269:9: FLOAT
                    {
                    root_0 = (Object)adaptor.nil();

                    FLOAT94=(Token)match(input,FLOAT,FOLLOW_FLOAT_in_field_type1704); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FLOAT94_tree = (Object)adaptor.create(FLOAT94);
                    adaptor.addChild(root_0, FLOAT94_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Float()); 
                    }

                    }
                    break;
                case 12 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:270:9: DOUBLE
                    {
                    root_0 = (Object)adaptor.nil();

                    DOUBLE95=(Token)match(input,DOUBLE,FOLLOW_DOUBLE_in_field_type1716); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    DOUBLE95_tree = (Object)adaptor.create(DOUBLE95);
                    adaptor.addChild(root_0, DOUBLE95_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Double()); 
                    }

                    }
                    break;
                case 13 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:271:9: BOOL
                    {
                    root_0 = (Object)adaptor.nil();

                    BOOL96=(Token)match(input,BOOL,FOLLOW_BOOL_in_field_type1728); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    BOOL96_tree = (Object)adaptor.create(BOOL96);
                    adaptor.addChild(root_0, BOOL96_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Bool()); 
                    }

                    }
                    break;
                case 14 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:272:9: STRING
                    {
                    root_0 = (Object)adaptor.nil();

                    STRING97=(Token)match(input,STRING,FOLLOW_STRING_in_field_type1740); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING97_tree = (Object)adaptor.create(STRING97);
                    adaptor.addChild(root_0, STRING97_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.String()); 
                    }

                    }
                    break;
                case 15 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:273:9: BYTES
                    {
                    root_0 = (Object)adaptor.nil();

                    BYTES98=(Token)match(input,BYTES,FOLLOW_BYTES_in_field_type1752); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    BYTES98_tree = (Object)adaptor.create(BYTES98);
                    adaptor.addChild(root_0, BYTES98_tree);
                    }
                    if ( state.backtracking==0 ) {
                       fieldHolder.setField(new Field.Bytes()); 
                    }

                    }
                    break;
                case 16 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:274:9: GROUP
                    {
                    root_0 = (Object)adaptor.nil();

                    GROUP99=(Token)match(input,GROUP,FOLLOW_GROUP_in_field_type1764); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    GROUP99_tree = (Object)adaptor.create(GROUP99);
                    adaptor.addChild(root_0, GROUP99_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  String suffix = proto.getFile()==null ? "" : " of " + proto.getFile().getName();
                                  warn("'group' not supported @ line " + (GROUP99!=null?GROUP99.getLine():0) + suffix);
                              
                    }

                    }
                    break;
                case 17 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:278:9: FULL_ID
                    {
                    root_0 = (Object)adaptor.nil();

                    FULL_ID100=(Token)match(input,FULL_ID,FOLLOW_FULL_ID_in_field_type1776); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FULL_ID100_tree = (Object)adaptor.create(FULL_ID100);
                    adaptor.addChild(root_0, FULL_ID100_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  String fullType = (FULL_ID100!=null?FULL_ID100.getText():null);
                                  int lastDot = fullType.lastIndexOf('.');
                                  String packageName = fullType.substring(0, lastDot); 
                                  String type = fullType.substring(lastDot+1);
                                  fieldHolder.setField(new Field.Reference(packageName, type, message));
                              
                    }

                    }
                    break;
                case 18 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:285:9: ID
                    {
                    root_0 = (Object)adaptor.nil();

                    ID101=(Token)match(input,ID,FOLLOW_ID_in_field_type1788); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    ID101_tree = (Object)adaptor.create(ID101);
                    adaptor.addChild(root_0, ID101_tree);
                    }
                    if ( state.backtracking==0 ) {
                       
                                  String type = (ID101!=null?ID101.getText():null);
                                  fieldHolder.setField(new Field.Reference(null, type, message));
                              
                    }

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "field_type"

    public static class field_options_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "field_options"
    // com/dyuproject/protostuff/parser/ProtoParser.g:291:1: field_options[Proto proto, HasFields message, Field field] : LEFTSQUARE field_options_keyval[proto, message, field] ( COMMA field_options_keyval[proto, message, field] )* RIGHTSQUARE ;
    public final ProtoParser.field_options_return field_options(Proto proto, HasFields message, Field field) throws RecognitionException {
        ProtoParser.field_options_return retval = new ProtoParser.field_options_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token LEFTSQUARE102=null;
        Token COMMA104=null;
        Token RIGHTSQUARE106=null;
        ProtoParser.field_options_keyval_return field_options_keyval103 = null;

        ProtoParser.field_options_keyval_return field_options_keyval105 = null;


        Object LEFTSQUARE102_tree=null;
        Object COMMA104_tree=null;
        Object RIGHTSQUARE106_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:292:5: ( LEFTSQUARE field_options_keyval[proto, message, field] ( COMMA field_options_keyval[proto, message, field] )* RIGHTSQUARE )
            // com/dyuproject/protostuff/parser/ProtoParser.g:292:9: LEFTSQUARE field_options_keyval[proto, message, field] ( COMMA field_options_keyval[proto, message, field] )* RIGHTSQUARE
            {
            root_0 = (Object)adaptor.nil();

            LEFTSQUARE102=(Token)match(input,LEFTSQUARE,FOLLOW_LEFTSQUARE_in_field_options1815); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTSQUARE102_tree = (Object)adaptor.create(LEFTSQUARE102);
            adaptor.addChild(root_0, LEFTSQUARE102_tree);
            }
            pushFollow(FOLLOW_field_options_keyval_in_field_options1817);
            field_options_keyval103=field_options_keyval(proto, message, field);

            state._fsp--;
            if (state.failed) return retval;
            if ( state.backtracking==0 ) adaptor.addChild(root_0, field_options_keyval103.getTree());
            // com/dyuproject/protostuff/parser/ProtoParser.g:293:9: ( COMMA field_options_keyval[proto, message, field] )*
            loop21:
            do {
                int alt21=2;
                switch ( input.LA(1) ) {
                case COMMA:
                    {
                    alt21=1;
                    }
                    break;

                }

                switch (alt21) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:293:10: COMMA field_options_keyval[proto, message, field]
            	    {
            	    COMMA104=(Token)match(input,COMMA,FOLLOW_COMMA_in_field_options1830); if (state.failed) return retval;
            	    if ( state.backtracking==0 ) {
            	    COMMA104_tree = (Object)adaptor.create(COMMA104);
            	    adaptor.addChild(root_0, COMMA104_tree);
            	    }
            	    pushFollow(FOLLOW_field_options_keyval_in_field_options1832);
            	    field_options_keyval105=field_options_keyval(proto, message, field);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, field_options_keyval105.getTree());

            	    }
            	    break;

            	default :
            	    break loop21;
                }
            } while (true);

            RIGHTSQUARE106=(Token)match(input,RIGHTSQUARE,FOLLOW_RIGHTSQUARE_in_field_options1837); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTSQUARE106_tree = (Object)adaptor.create(RIGHTSQUARE106);
            adaptor.addChild(root_0, RIGHTSQUARE106_tree);
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "field_options"

    public static class field_options_keyval_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "field_options_keyval"
    // com/dyuproject/protostuff/parser/ProtoParser.g:296:1: field_options_keyval[Proto proto, HasFields message, Field field] : key= ( DEFAULT | ID ) ASSIGN ( STRING_LITERAL | NUMFLOAT | NUMINT | NUMDOUBLE | HEX | OCTAL | TRUE | FALSE | val= ID | EXP | signed_constant[proto, message, field, $key.text] ) ;
    public final ProtoParser.field_options_keyval_return field_options_keyval(Proto proto, HasFields message, Field field) throws RecognitionException {
        ProtoParser.field_options_keyval_return retval = new ProtoParser.field_options_keyval_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token key=null;
        Token val=null;
        Token ASSIGN107=null;
        Token STRING_LITERAL108=null;
        Token NUMFLOAT109=null;
        Token NUMINT110=null;
        Token NUMDOUBLE111=null;
        Token HEX112=null;
        Token OCTAL113=null;
        Token TRUE114=null;
        Token FALSE115=null;
        Token EXP116=null;
        ProtoParser.signed_constant_return signed_constant117 = null;


        Object key_tree=null;
        Object val_tree=null;
        Object ASSIGN107_tree=null;
        Object STRING_LITERAL108_tree=null;
        Object NUMFLOAT109_tree=null;
        Object NUMINT110_tree=null;
        Object NUMDOUBLE111_tree=null;
        Object HEX112_tree=null;
        Object OCTAL113_tree=null;
        Object TRUE114_tree=null;
        Object FALSE115_tree=null;
        Object EXP116_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:297:5: (key= ( DEFAULT | ID ) ASSIGN ( STRING_LITERAL | NUMFLOAT | NUMINT | NUMDOUBLE | HEX | OCTAL | TRUE | FALSE | val= ID | EXP | signed_constant[proto, message, field, $key.text] ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:297:9: key= ( DEFAULT | ID ) ASSIGN ( STRING_LITERAL | NUMFLOAT | NUMINT | NUMDOUBLE | HEX | OCTAL | TRUE | FALSE | val= ID | EXP | signed_constant[proto, message, field, $key.text] )
            {
            root_0 = (Object)adaptor.nil();

            key=(Token)input.LT(1);
            if ( input.LA(1)==DEFAULT||input.LA(1)==ID ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(key));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }

            ASSIGN107=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_field_options_keyval1870); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN107_tree = (Object)adaptor.create(ASSIGN107);
            adaptor.addChild(root_0, ASSIGN107_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:297:33: ( STRING_LITERAL | NUMFLOAT | NUMINT | NUMDOUBLE | HEX | OCTAL | TRUE | FALSE | val= ID | EXP | signed_constant[proto, message, field, $key.text] )
            int alt22=11;
            switch ( input.LA(1) ) {
            case STRING_LITERAL:
                {
                alt22=1;
                }
                break;
            case NUMFLOAT:
                {
                alt22=2;
                }
                break;
            case NUMINT:
                {
                alt22=3;
                }
                break;
            case NUMDOUBLE:
                {
                alt22=4;
                }
                break;
            case HEX:
                {
                alt22=5;
                }
                break;
            case OCTAL:
                {
                alt22=6;
                }
                break;
            case TRUE:
                {
                alt22=7;
                }
                break;
            case FALSE:
                {
                alt22=8;
                }
                break;
            case ID:
                {
                alt22=9;
                }
                break;
            case EXP:
                {
                alt22=10;
                }
                break;
            case MINUS:
                {
                alt22=11;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 22, 0, input);

                throw nvae;
            }

            switch (alt22) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:297:34: STRING_LITERAL
                    {
                    STRING_LITERAL108=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_field_options_keyval1873); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING_LITERAL108_tree = (Object)adaptor.create(STRING_LITERAL108);
                    adaptor.addChild(root_0, STRING_LITERAL108_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.String)
                                          field.defaultValue = getStringFromStringLiteral((STRING_LITERAL108!=null?STRING_LITERAL108.getText():null));
                                      else if(field instanceof Field.Bytes)
                                          field.defaultValue = getBytesFromStringLiteral((STRING_LITERAL108!=null?STRING_LITERAL108.getText():null));
                                      else
                                          throw new IllegalStateException("Invalid string default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), getStringFromStringLiteral((STRING_LITERAL108!=null?STRING_LITERAL108.getText():null)));
                              
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:312:9: NUMFLOAT
                    {
                    NUMFLOAT109=(Token)match(input,NUMFLOAT,FOLLOW_NUMFLOAT_in_field_options_keyval1886); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMFLOAT109_tree = (Object)adaptor.create(NUMFLOAT109);
                    adaptor.addChild(root_0, NUMFLOAT109_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Float)
                                          field.defaultValue = Float.valueOf((NUMFLOAT109!=null?NUMFLOAT109.getText():null));
                                      else if(field instanceof Field.Double) 
                                          field.defaultValue = Double.valueOf((NUMFLOAT109!=null?NUMFLOAT109.getText():null));
                                      else
                                          throw new IllegalStateException("Invalid float default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), Float.valueOf((NUMFLOAT109!=null?NUMFLOAT109.getText():null)));
                              
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:327:9: NUMINT
                    {
                    NUMINT110=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_field_options_keyval1899); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMINT110_tree = (Object)adaptor.create(NUMINT110);
                    adaptor.addChild(root_0, NUMINT110_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Number) {
                                          if(field.getClass().getSimpleName().endsWith("32"))
                                              field.defaultValue = Integer.valueOf((NUMINT110!=null?NUMINT110.getText():null));
                                          else if(field.getClass().getSimpleName().endsWith("64"))
                                              field.defaultValue = Long.valueOf((NUMINT110!=null?NUMINT110.getText():null));
                                          else if(field instanceof Field.Float)
                                              field.defaultValue = Float.valueOf((NUMINT110!=null?NUMINT110.getText():null));
                                          else if(field instanceof Field.Double) 
                                              field.defaultValue = Double.valueOf((NUMINT110!=null?NUMINT110.getText():null));
                                          else
                                              throw new IllegalStateException("Invalid numeric default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                      }
                                      else
                                          throw new IllegalStateException("Invalid numeric default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), Integer.valueOf((NUMINT110!=null?NUMINT110.getText():null)));
                              
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:350:9: NUMDOUBLE
                    {
                    NUMDOUBLE111=(Token)match(input,NUMDOUBLE,FOLLOW_NUMDOUBLE_in_field_options_keyval1911); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMDOUBLE111_tree = (Object)adaptor.create(NUMDOUBLE111);
                    adaptor.addChild(root_0, NUMDOUBLE111_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");

                                      if(field instanceof Field.Float)
                                          field.defaultValue = Float.valueOf((NUMDOUBLE111!=null?NUMDOUBLE111.getText():null));
                                      else if(field instanceof Field.Double) 
                                          field.defaultValue = Double.valueOf((NUMDOUBLE111!=null?NUMDOUBLE111.getText():null));
                                      else
                                          throw new IllegalStateException("Invalid numeric default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), Double.valueOf((NUMDOUBLE111!=null?NUMDOUBLE111.getText():null)));
                              
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:365:9: HEX
                    {
                    HEX112=(Token)match(input,HEX,FOLLOW_HEX_in_field_options_keyval1923); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    HEX112_tree = (Object)adaptor.create(HEX112);
                    adaptor.addChild(root_0, HEX112_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Number) {
                                          if(field instanceof Field.Int32)
                                              field.defaultValue = new Integer(TextFormat.parseInt32((HEX112!=null?HEX112.getText():null)));
                                          else if(field instanceof Field.UInt32)
                                              field.defaultValue = new Integer(TextFormat.parseUInt32((HEX112!=null?HEX112.getText():null)));
                                          else if(field instanceof Field.Int64)
                                              field.defaultValue = new Long(TextFormat.parseInt64((HEX112!=null?HEX112.getText():null)));
                                          else if(field instanceof Field.UInt64)
                                              field.defaultValue = new Long(TextFormat.parseUInt64((HEX112!=null?HEX112.getText():null)));
                                          else if(field instanceof Field.Float)
                                              field.defaultValue = new Float(Long.decode((HEX112!=null?HEX112.getText():null)).floatValue());
                                          else if(field instanceof Field.Double) 
                                              field.defaultValue = new Double(Long.decode((HEX112!=null?HEX112.getText():null)).doubleValue());
                                      }
                                      else if(field instanceof Field.Bytes) {
                                          field.defaultValue = getBytesFromHexString((HEX112!=null?HEX112.getText():null));
                                      }
                                      else
                                          throw new IllegalStateException("Invalid numeric default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                      
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), (HEX112!=null?HEX112.getText():null));
                              
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:394:9: OCTAL
                    {
                    OCTAL113=(Token)match(input,OCTAL,FOLLOW_OCTAL_in_field_options_keyval1935); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    OCTAL113_tree = (Object)adaptor.create(OCTAL113);
                    adaptor.addChild(root_0, OCTAL113_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Number) {
                                          if(field instanceof Field.Int32)
                                              field.defaultValue = new Integer(TextFormat.parseInt32((OCTAL113!=null?OCTAL113.getText():null)));
                                          else if(field instanceof Field.UInt32)
                                              field.defaultValue = new Integer(TextFormat.parseUInt32((OCTAL113!=null?OCTAL113.getText():null)));
                                          else if(field instanceof Field.Int64)
                                              field.defaultValue = new Long(TextFormat.parseInt64((OCTAL113!=null?OCTAL113.getText():null)));
                                          else if(field instanceof Field.UInt64)
                                              field.defaultValue = new Long(TextFormat.parseUInt64((OCTAL113!=null?OCTAL113.getText():null)));
                                          else if(field instanceof Field.Float)
                                              field.defaultValue = new Float(Long.decode((OCTAL113!=null?OCTAL113.getText():null)).floatValue());
                                          else if(field instanceof Field.Double) 
                                              field.defaultValue = new Double(Long.decode((OCTAL113!=null?OCTAL113.getText():null)).doubleValue());
                                      }
                                      else
                                          throw new IllegalStateException("Invalid numeric default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), (OCTAL113!=null?OCTAL113.getText():null));
                              
                    }

                    }
                    break;
                case 7 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:419:9: TRUE
                    {
                    TRUE114=(Token)match(input,TRUE,FOLLOW_TRUE_in_field_options_keyval1947); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TRUE114_tree = (Object)adaptor.create(TRUE114);
                    adaptor.addChild(root_0, TRUE114_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Bool)
                                          field.defaultValue = Boolean.TRUE;
                                      else
                                          throw new IllegalStateException("invalid boolean default value for the non-boolean field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), Boolean.TRUE);
                              
                    }

                    }
                    break;
                case 8 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:432:9: FALSE
                    {
                    FALSE115=(Token)match(input,FALSE,FOLLOW_FALSE_in_field_options_keyval1963); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FALSE115_tree = (Object)adaptor.create(FALSE115);
                    adaptor.addChild(root_0, FALSE115_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Bool)
                                          field.defaultValue = Boolean.FALSE;
                                      else
                                          throw new IllegalStateException("invalid boolean default value for the non-boolean field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), Boolean.FALSE);
                              
                    }

                    }
                    break;
                case 9 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:445:9: val= ID
                    {
                    val=(Token)match(input,ID,FOLLOW_ID_in_field_options_keyval1977); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    val_tree = (Object)adaptor.create(val);
                    adaptor.addChild(root_0, val_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      String refName = (val!=null?val.getText():null);
                                      if(field instanceof Field.Reference)
                                          field.defaultValue = refName;
                                      else if(field instanceof Field.Float) {
                                          if("inf".equals(refName)) {
                                              field.defaultValue = Float.POSITIVE_INFINITY;
                                              field.defaultValueConstant = "Float.POSITIVE_INFINITY";
                                          }
                                          else if("nan".equals(refName)) {
                                              field.defaultValue = Float.NaN;
                                              field.defaultValueConstant = "Float.NaN";
                                          }
                                          else
                                              throw new IllegalStateException("Invalid float default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                      }
                                      else if(field instanceof Field.Double) {
                                          if("inf".equals(refName)) {
                                              field.defaultValue = Double.POSITIVE_INFINITY;
                                              field.defaultValueConstant = "Double.POSITIVE_INFINITY";
                                          }
                                          else if("nan".equals(refName)) {
                                              field.defaultValue = Double.NaN;
                                              field.defaultValueConstant = "Double.NaN";
                                          }
                                          else
                                              throw new IllegalStateException("Invalid double default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                      }   
                                      else
                                          throw new IllegalStateException("invalid field value '" + refName + "' for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), (val!=null?val.getText():null));
                              
                    }

                    }
                    break;
                case 10 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:483:9: EXP
                    {
                    EXP116=(Token)match(input,EXP,FOLLOW_EXP_in_field_options_keyval1989); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    EXP116_tree = (Object)adaptor.create(EXP116);
                    adaptor.addChild(root_0, EXP116_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  if("default".equals((key!=null?key.getText():null))) {
                                      if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                          throw new IllegalStateException("a field can only have a single default value");
                                      
                                      if(field instanceof Field.Float)
                                          field.defaultValue = Float.valueOf((EXP116!=null?EXP116.getText():null));
                                      else if(field instanceof Field.Double) 
                                          field.defaultValue = Double.valueOf((EXP116!=null?EXP116.getText():null));
                                      else
                                          throw new IllegalStateException("Invalid float default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                                  }
                                  
                                  field.putOption((key!=null?key.getText():null), (EXP116!=null?EXP116.getText():null));
                              
                    }

                    }
                    break;
                case 11 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:498:9: signed_constant[proto, message, field, $key.text]
                    {
                    pushFollow(FOLLOW_signed_constant_in_field_options_keyval2001);
                    signed_constant117=signed_constant(proto, message, field, (key!=null?key.getText():null));

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, signed_constant117.getTree());
                    if ( state.backtracking==0 ) {

                                  field.putOption((key!=null?key.getText():null), (signed_constant117!=null?input.toString(signed_constant117.start,signed_constant117.stop):null));
                              
                    }

                    }
                    break;

            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "field_options_keyval"

    public static class signed_constant_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "signed_constant"
    // com/dyuproject/protostuff/parser/ProtoParser.g:504:1: signed_constant[Proto proto, HasFields message, Field field, String key] : MINUS ID ;
    public final ProtoParser.signed_constant_return signed_constant(Proto proto, HasFields message, Field field, String key) throws RecognitionException {
        ProtoParser.signed_constant_return retval = new ProtoParser.signed_constant_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token MINUS118=null;
        Token ID119=null;

        Object MINUS118_tree=null;
        Object ID119_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:505:5: ( MINUS ID )
            // com/dyuproject/protostuff/parser/ProtoParser.g:505:9: MINUS ID
            {
            root_0 = (Object)adaptor.nil();

            MINUS118=(Token)match(input,MINUS,FOLLOW_MINUS_in_signed_constant2039); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            MINUS118_tree = (Object)adaptor.create(MINUS118);
            adaptor.addChild(root_0, MINUS118_tree);
            }
            ID119=(Token)match(input,ID,FOLLOW_ID_in_signed_constant2041); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ID119_tree = (Object)adaptor.create(ID119);
            adaptor.addChild(root_0, ID119_tree);
            }
            if ( state.backtracking==0 ) {

                          if("default".equals(key)) {
                              if(field.defaultValue!=null || field.modifier == Field.Modifier.REPEATED)
                                  throw new IllegalStateException("a field can only have a single default value");
                              
                              String refName = (ID119!=null?ID119.getText():null);
                              if(field instanceof Field.Float) {
                                  if("inf".equals(refName)) {
                                      field.defaultValue = Float.NEGATIVE_INFINITY;
                                      field.defaultValueConstant = "Float.NEGATIVE_INFINITY";
                                  }
                                  else
                                      throw new IllegalStateException("Invalid float default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                              }
                              else if(field instanceof Field.Double) {
                                  if("inf".equals(refName)) {
                                      field.defaultValue = Double.NEGATIVE_INFINITY;
                                      field.defaultValueConstant = "Double.NEGATIVE_INFINITY";
                                  }
                                  else
                                      throw new IllegalStateException("Invalid double default value for the field: " + field.getClass().getSimpleName() + " " + field.name);
                              }   
                              else
                                  throw new IllegalStateException("invalid field value '" + refName + "' for the field: " + field.getClass().getSimpleName() + " " + field.name);
                          }
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "signed_constant"

    public static class enum_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "enum_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:533:1: enum_block[Proto proto, Message message] : ENUM ID LEFTCURLY ( enum_body[proto, message, enumGroup] )* RIGHTCURLY ( ( SEMICOLON )? ) ;
    public final ProtoParser.enum_block_return enum_block(Proto proto, Message message) throws RecognitionException {
        ProtoParser.enum_block_return retval = new ProtoParser.enum_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token ENUM120=null;
        Token ID121=null;
        Token LEFTCURLY122=null;
        Token RIGHTCURLY124=null;
        Token SEMICOLON125=null;
        ProtoParser.enum_body_return enum_body123 = null;


        Object ENUM120_tree=null;
        Object ID121_tree=null;
        Object LEFTCURLY122_tree=null;
        Object RIGHTCURLY124_tree=null;
        Object SEMICOLON125_tree=null;


            EnumGroup enumGroup = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:537:5: ( ENUM ID LEFTCURLY ( enum_body[proto, message, enumGroup] )* RIGHTCURLY ( ( SEMICOLON )? ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:537:9: ENUM ID LEFTCURLY ( enum_body[proto, message, enumGroup] )* RIGHTCURLY ( ( SEMICOLON )? )
            {
            root_0 = (Object)adaptor.nil();

            ENUM120=(Token)match(input,ENUM,FOLLOW_ENUM_in_enum_block2073); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ENUM120_tree = (Object)adaptor.create(ENUM120);
            adaptor.addChild(root_0, ENUM120_tree);
            }
            ID121=(Token)match(input,ID,FOLLOW_ID_in_enum_block2075); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ID121_tree = (Object)adaptor.create(ID121);
            adaptor.addChild(root_0, ID121_tree);
            }
            if ( state.backtracking==0 ) {
               enumGroup = new EnumGroup((ID121!=null?ID121.getText():null)); 
            }
            LEFTCURLY122=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_enum_block2079); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY122_tree = (Object)adaptor.create(LEFTCURLY122);
            adaptor.addChild(root_0, LEFTCURLY122_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:538:9: ( enum_body[proto, message, enumGroup] )*
            loop23:
            do {
                int alt23=2;
                switch ( input.LA(1) ) {
                case OPTION:
                case ID:
                    {
                    alt23=1;
                    }
                    break;

                }

                switch (alt23) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:538:10: enum_body[proto, message, enumGroup]
            	    {
            	    pushFollow(FOLLOW_enum_body_in_enum_block2091);
            	    enum_body123=enum_body(proto, message, enumGroup);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_body123.getTree());

            	    }
            	    break;

            	default :
            	    break loop23;
                }
            } while (true);

            RIGHTCURLY124=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_enum_block2096); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY124_tree = (Object)adaptor.create(RIGHTCURLY124);
            adaptor.addChild(root_0, RIGHTCURLY124_tree);
            }
            if ( state.backtracking==0 ) {

                          if(message==null)
                              proto.addEnumGroup(enumGroup);
                          else
                              message.addNestedEnumGroup(enumGroup);
                              
                          enumGroup.addAnnotations(proto.annotations, true);
                          
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:546:11: ( ( SEMICOLON )? )
            // com/dyuproject/protostuff/parser/ProtoParser.g:546:12: ( SEMICOLON )?
            {
            // com/dyuproject/protostuff/parser/ProtoParser.g:546:12: ( SEMICOLON )?
            int alt24=2;
            switch ( input.LA(1) ) {
                case SEMICOLON:
                    {
                    alt24=1;
                    }
                    break;
            }

            switch (alt24) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:546:12: SEMICOLON
                    {
                    SEMICOLON125=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_enum_block2101); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SEMICOLON125_tree = (Object)adaptor.create(SEMICOLON125);
                    adaptor.addChild(root_0, SEMICOLON125_tree);
                    }

                    }
                    break;

            }


            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "enum_block"

    public static class enum_body_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "enum_body"
    // com/dyuproject/protostuff/parser/ProtoParser.g:549:1: enum_body[Proto proto, Message message, EnumGroup enumGroup] : ( enum_field[proto, message, enumGroup] | enum_option[proto, enumGroup] );
    public final ProtoParser.enum_body_return enum_body(Proto proto, Message message, EnumGroup enumGroup) throws RecognitionException {
        ProtoParser.enum_body_return retval = new ProtoParser.enum_body_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        ProtoParser.enum_field_return enum_field126 = null;

        ProtoParser.enum_option_return enum_option127 = null;



        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:550:5: ( enum_field[proto, message, enumGroup] | enum_option[proto, enumGroup] )
            int alt25=2;
            switch ( input.LA(1) ) {
            case ID:
                {
                alt25=1;
                }
                break;
            case OPTION:
                {
                alt25=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 25, 0, input);

                throw nvae;
            }

            switch (alt25) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:550:9: enum_field[proto, message, enumGroup]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_enum_field_in_enum_body2129);
                    enum_field126=enum_field(proto, message, enumGroup);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_field126.getTree());

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:551:9: enum_option[proto, enumGroup]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_enum_option_in_enum_body2140);
                    enum_option127=enum_option(proto, enumGroup);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, enum_option127.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "enum_body"

    public static class enum_option_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "enum_option"
    // com/dyuproject/protostuff/parser/ProtoParser.g:554:1: enum_option[Proto proto, EnumGroup enumGroup] : OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON ;
    public final ProtoParser.enum_option_return enum_option(Proto proto, EnumGroup enumGroup) throws RecognitionException {
        ProtoParser.enum_option_return retval = new ProtoParser.enum_option_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token n=null;
        Token v=null;
        Token OPTION128=null;
        Token LEFTPAREN129=null;
        Token RIGHTPAREN130=null;
        Token ASSIGN131=null;
        Token STRING_LITERAL132=null;
        Token TRUE133=null;
        Token FALSE134=null;
        Token NUMINT135=null;
        Token NUMFLOAT136=null;
        Token SEMICOLON137=null;

        Object n_tree=null;
        Object v_tree=null;
        Object OPTION128_tree=null;
        Object LEFTPAREN129_tree=null;
        Object RIGHTPAREN130_tree=null;
        Object ASSIGN131_tree=null;
        Object STRING_LITERAL132_tree=null;
        Object TRUE133_tree=null;
        Object FALSE134_tree=null;
        Object NUMINT135_tree=null;
        Object NUMFLOAT136_tree=null;
        Object SEMICOLON137_tree=null;


            boolean standard = false;
            String value = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:559:5: ( OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:559:9: OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            OPTION128=(Token)match(input,OPTION,FOLLOW_OPTION_in_enum_option2171); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            OPTION128_tree = (Object)adaptor.create(OPTION128);
            adaptor.addChild(root_0, OPTION128_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:559:16: ( LEFTPAREN )?
            int alt26=2;
            switch ( input.LA(1) ) {
                case LEFTPAREN:
                    {
                    alt26=1;
                    }
                    break;
            }

            switch (alt26) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:559:16: LEFTPAREN
                    {
                    LEFTPAREN129=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_enum_option2173); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    LEFTPAREN129_tree = (Object)adaptor.create(LEFTPAREN129);
                    adaptor.addChild(root_0, LEFTPAREN129_tree);
                    }

                    }
                    break;

            }

            n=(Token)input.LT(1);
            if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(n));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }

            // com/dyuproject/protostuff/parser/ProtoParser.g:559:42: ( RIGHTPAREN )?
            int alt27=2;
            switch ( input.LA(1) ) {
                case RIGHTPAREN:
                    {
                    alt27=1;
                    }
                    break;
            }

            switch (alt27) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:559:42: RIGHTPAREN
                    {
                    RIGHTPAREN130=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_enum_option2184); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    RIGHTPAREN130_tree = (Object)adaptor.create(RIGHTPAREN130);
                    adaptor.addChild(root_0, RIGHTPAREN130_tree);
                    }

                    }
                    break;

            }

            ASSIGN131=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_enum_option2187); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN131_tree = (Object)adaptor.create(ASSIGN131);
            adaptor.addChild(root_0, ASSIGN131_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:559:61: (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT )
            int alt28=6;
            switch ( input.LA(1) ) {
            case ID:
            case FULL_ID:
                {
                alt28=1;
                }
                break;
            case STRING_LITERAL:
                {
                alt28=2;
                }
                break;
            case TRUE:
                {
                alt28=3;
                }
                break;
            case FALSE:
                {
                alt28=4;
                }
                break;
            case NUMINT:
                {
                alt28=5;
                }
                break;
            case NUMFLOAT:
                {
                alt28=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 28, 0, input);

                throw nvae;
            }

            switch (alt28) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:560:13: v= ( ID | FULL_ID )
                    {
                    v=(Token)input.LT(1);
                    if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(v));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    if ( state.backtracking==0 ) {
                       standard = true; value = (v!=null?v.getText():null); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:561:15: STRING_LITERAL
                    {
                    STRING_LITERAL132=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_enum_option2228); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING_LITERAL132_tree = (Object)adaptor.create(STRING_LITERAL132);
                    adaptor.addChild(root_0, STRING_LITERAL132_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = getStringFromStringLiteral((STRING_LITERAL132!=null?STRING_LITERAL132.getText():null)); 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:562:15: TRUE
                    {
                    TRUE133=(Token)match(input,TRUE,FOLLOW_TRUE_in_enum_option2246); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TRUE133_tree = (Object)adaptor.create(TRUE133);
                    adaptor.addChild(root_0, TRUE133_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "true"; 
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:563:15: FALSE
                    {
                    FALSE134=(Token)match(input,FALSE,FOLLOW_FALSE_in_enum_option2264); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FALSE134_tree = (Object)adaptor.create(FALSE134);
                    adaptor.addChild(root_0, FALSE134_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "false"; 
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:564:15: NUMINT
                    {
                    NUMINT135=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_enum_option2282); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMINT135_tree = (Object)adaptor.create(NUMINT135);
                    adaptor.addChild(root_0, NUMINT135_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = (NUMINT135!=null?NUMINT135.getText():null); 
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:565:15: NUMFLOAT
                    {
                    NUMFLOAT136=(Token)match(input,NUMFLOAT,FOLLOW_NUMFLOAT_in_enum_option2300); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMFLOAT136_tree = (Object)adaptor.create(NUMFLOAT136);
                    adaptor.addChild(root_0, NUMFLOAT136_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Float.valueOf((NUMFLOAT136!=null?NUMFLOAT136.getText():null)).toString(); 
                    }

                    }
                    break;

            }

            SEMICOLON137=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_enum_option2314); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(standard)
                              enumGroup.putStandardOption((n!=null?n.getText():null), value);
                          else
                              enumGroup.putExtraOption((n!=null?n.getText():null), value);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "enum_option"

    public static class enum_field_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "enum_field"
    // com/dyuproject/protostuff/parser/ProtoParser.g:574:1: enum_field[Proto proto, Message message, EnumGroup enumGroup] : ID ASSIGN NUMINT SEMICOLON ;
    public final ProtoParser.enum_field_return enum_field(Proto proto, Message message, EnumGroup enumGroup) throws RecognitionException {
        ProtoParser.enum_field_return retval = new ProtoParser.enum_field_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token ID138=null;
        Token ASSIGN139=null;
        Token NUMINT140=null;
        Token SEMICOLON141=null;

        Object ID138_tree=null;
        Object ASSIGN139_tree=null;
        Object NUMINT140_tree=null;
        Object SEMICOLON141_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:575:5: ( ID ASSIGN NUMINT SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:575:9: ID ASSIGN NUMINT SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            ID138=(Token)match(input,ID,FOLLOW_ID_in_enum_field2342); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ID138_tree = (Object)adaptor.create(ID138);
            adaptor.addChild(root_0, ID138_tree);
            }
            ASSIGN139=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_enum_field2344); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN139_tree = (Object)adaptor.create(ASSIGN139);
            adaptor.addChild(root_0, ASSIGN139_tree);
            }
            NUMINT140=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_enum_field2346); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            NUMINT140_tree = (Object)adaptor.create(NUMINT140);
            adaptor.addChild(root_0, NUMINT140_tree);
            }
            SEMICOLON141=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_enum_field2348); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          enumGroup.add(new EnumGroup.Value((ID138!=null?ID138.getText():null), Integer.parseInt((NUMINT140!=null?NUMINT140.getText():null))));
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "enum_field"

    public static class service_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "service_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:580:1: service_block[Proto proto] : SERVICE ID LEFTCURLY ( service_body[proto, service] )+ RIGHTCURLY ( ( SEMICOLON )? ) ;
    public final ProtoParser.service_block_return service_block(Proto proto) throws RecognitionException {
        ProtoParser.service_block_return retval = new ProtoParser.service_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token SERVICE142=null;
        Token ID143=null;
        Token LEFTCURLY144=null;
        Token RIGHTCURLY146=null;
        Token SEMICOLON147=null;
        ProtoParser.service_body_return service_body145 = null;


        Object SERVICE142_tree=null;
        Object ID143_tree=null;
        Object LEFTCURLY144_tree=null;
        Object RIGHTCURLY146_tree=null;
        Object SEMICOLON147_tree=null;


            Service service = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:584:5: ( SERVICE ID LEFTCURLY ( service_body[proto, service] )+ RIGHTCURLY ( ( SEMICOLON )? ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:584:9: SERVICE ID LEFTCURLY ( service_body[proto, service] )+ RIGHTCURLY ( ( SEMICOLON )? )
            {
            root_0 = (Object)adaptor.nil();

            SERVICE142=(Token)match(input,SERVICE,FOLLOW_SERVICE_in_service_block2381); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            SERVICE142_tree = (Object)adaptor.create(SERVICE142);
            adaptor.addChild(root_0, SERVICE142_tree);
            }
            ID143=(Token)match(input,ID,FOLLOW_ID_in_service_block2383); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ID143_tree = (Object)adaptor.create(ID143);
            adaptor.addChild(root_0, ID143_tree);
            }
            if ( state.backtracking==0 ) {
               
                          service = new Service((ID143!=null?ID143.getText():null), proto); 
                          service.addAnnotations(proto.annotations, true);
                      
            }
            LEFTCURLY144=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_service_block2387); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY144_tree = (Object)adaptor.create(LEFTCURLY144);
            adaptor.addChild(root_0, LEFTCURLY144_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:588:9: ( service_body[proto, service] )+
            int cnt29=0;
            loop29:
            do {
                int alt29=2;
                switch ( input.LA(1) ) {
                case AT:
                case RPC:
                    {
                    alt29=1;
                    }
                    break;

                }

                switch (alt29) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:588:10: service_body[proto, service]
            	    {
            	    pushFollow(FOLLOW_service_body_in_service_block2398);
            	    service_body145=service_body(proto, service);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, service_body145.getTree());

            	    }
            	    break;

            	default :
            	    if ( cnt29 >= 1 ) break loop29;
            	    if (state.backtracking>0) {state.failed=true; return retval;}
                        EarlyExitException eee =
                            new EarlyExitException(29, input);
                        throw eee;
                }
                cnt29++;
            } while (true);

            RIGHTCURLY146=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_service_block2403); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY146_tree = (Object)adaptor.create(RIGHTCURLY146);
            adaptor.addChild(root_0, RIGHTCURLY146_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:588:52: ( ( SEMICOLON )? )
            // com/dyuproject/protostuff/parser/ProtoParser.g:588:53: ( SEMICOLON )?
            {
            // com/dyuproject/protostuff/parser/ProtoParser.g:588:53: ( SEMICOLON )?
            int alt30=2;
            switch ( input.LA(1) ) {
                case SEMICOLON:
                    {
                    alt30=1;
                    }
                    break;
            }

            switch (alt30) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:588:53: SEMICOLON
                    {
                    SEMICOLON147=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_service_block2406); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SEMICOLON147_tree = (Object)adaptor.create(SEMICOLON147);
                    adaptor.addChild(root_0, SEMICOLON147_tree);
                    }

                    }
                    break;

            }


            }

            if ( state.backtracking==0 ) {

                          if(service.rpcMethods.isEmpty())
                              throw new IllegalStateException("Empty Service block: " + service.getName());
                              
                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "service_block"

    public static class service_body_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "service_body"
    // com/dyuproject/protostuff/parser/ProtoParser.g:597:1: service_body[Proto proto, Service service] : ( rpc_block[proto, service] | annotation_entry[proto] );
    public final ProtoParser.service_body_return service_body(Proto proto, Service service) throws RecognitionException {
        ProtoParser.service_body_return retval = new ProtoParser.service_body_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        ProtoParser.rpc_block_return rpc_block148 = null;

        ProtoParser.annotation_entry_return annotation_entry149 = null;



        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:598:5: ( rpc_block[proto, service] | annotation_entry[proto] )
            int alt31=2;
            switch ( input.LA(1) ) {
            case RPC:
                {
                alt31=1;
                }
                break;
            case AT:
                {
                alt31=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 31, 0, input);

                throw nvae;
            }

            switch (alt31) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:598:9: rpc_block[proto, service]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_rpc_block_in_service_body2436);
                    rpc_block148=rpc_block(proto, service);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, rpc_block148.getTree());

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:599:9: annotation_entry[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_annotation_entry_in_service_body2447);
                    annotation_entry149=annotation_entry(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_entry149.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "service_body"

    public static class rpc_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "rpc_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:602:1: rpc_block[Proto proto, Service service] : RPC n= ID LEFTPAREN (ap= FULL_ID | a= ( VOID | ID ) ) RIGHTPAREN RETURNS LEFTPAREN (rp= FULL_ID | r= ( VOID | ID ) ) RIGHTPAREN ( rpc_body_block[proto, rm] )? SEMICOLON ;
    public final ProtoParser.rpc_block_return rpc_block(Proto proto, Service service) throws RecognitionException {
        ProtoParser.rpc_block_return retval = new ProtoParser.rpc_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token n=null;
        Token ap=null;
        Token a=null;
        Token rp=null;
        Token r=null;
        Token RPC150=null;
        Token LEFTPAREN151=null;
        Token RIGHTPAREN152=null;
        Token RETURNS153=null;
        Token LEFTPAREN154=null;
        Token RIGHTPAREN155=null;
        Token SEMICOLON157=null;
        ProtoParser.rpc_body_block_return rpc_body_block156 = null;


        Object n_tree=null;
        Object ap_tree=null;
        Object a_tree=null;
        Object rp_tree=null;
        Object r_tree=null;
        Object RPC150_tree=null;
        Object LEFTPAREN151_tree=null;
        Object RIGHTPAREN152_tree=null;
        Object RETURNS153_tree=null;
        Object LEFTPAREN154_tree=null;
        Object RIGHTPAREN155_tree=null;
        Object SEMICOLON157_tree=null;


            String argName = null, argPackage = null, retName = null, retPackage = null;
            Service.RpcMethod rm = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:607:5: ( RPC n= ID LEFTPAREN (ap= FULL_ID | a= ( VOID | ID ) ) RIGHTPAREN RETURNS LEFTPAREN (rp= FULL_ID | r= ( VOID | ID ) ) RIGHTPAREN ( rpc_body_block[proto, rm] )? SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:607:9: RPC n= ID LEFTPAREN (ap= FULL_ID | a= ( VOID | ID ) ) RIGHTPAREN RETURNS LEFTPAREN (rp= FULL_ID | r= ( VOID | ID ) ) RIGHTPAREN ( rpc_body_block[proto, rm] )? SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            RPC150=(Token)match(input,RPC,FOLLOW_RPC_in_rpc_block2478); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RPC150_tree = (Object)adaptor.create(RPC150);
            adaptor.addChild(root_0, RPC150_tree);
            }
            n=(Token)match(input,ID,FOLLOW_ID_in_rpc_block2482); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            n_tree = (Object)adaptor.create(n);
            adaptor.addChild(root_0, n_tree);
            }
            LEFTPAREN151=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_rpc_block2484); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTPAREN151_tree = (Object)adaptor.create(LEFTPAREN151);
            adaptor.addChild(root_0, LEFTPAREN151_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:607:28: (ap= FULL_ID | a= ( VOID | ID ) )
            int alt32=2;
            switch ( input.LA(1) ) {
            case FULL_ID:
                {
                alt32=1;
                }
                break;
            case VOID:
            case ID:
                {
                alt32=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 32, 0, input);

                throw nvae;
            }

            switch (alt32) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:607:29: ap= FULL_ID
                    {
                    ap=(Token)match(input,FULL_ID,FOLLOW_FULL_ID_in_rpc_block2489); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    ap_tree = (Object)adaptor.create(ap);
                    adaptor.addChild(root_0, ap_tree);
                    }
                    if ( state.backtracking==0 ) {
                        
                                  String argFull = (ap!=null?ap.getText():null);
                                  int lastDot = argFull.lastIndexOf('.');
                                  argPackage = argFull.substring(0, lastDot); 
                                  argName = argFull.substring(lastDot+1);
                              
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:612:13: a= ( VOID | ID )
                    {
                    a=(Token)input.LT(1);
                    if ( (input.LA(1)>=VOID && input.LA(1)<=ID) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(a));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    if ( state.backtracking==0 ) {
                       argName = (a!=null?a.getText():null); 
                    }

                    }
                    break;

            }

            RIGHTPAREN152=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_rpc_block2506); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTPAREN152_tree = (Object)adaptor.create(RIGHTPAREN152);
            adaptor.addChild(root_0, RIGHTPAREN152_tree);
            }
            RETURNS153=(Token)match(input,RETURNS,FOLLOW_RETURNS_in_rpc_block2517); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RETURNS153_tree = (Object)adaptor.create(RETURNS153);
            adaptor.addChild(root_0, RETURNS153_tree);
            }
            LEFTPAREN154=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_rpc_block2519); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTPAREN154_tree = (Object)adaptor.create(LEFTPAREN154);
            adaptor.addChild(root_0, LEFTPAREN154_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:613:27: (rp= FULL_ID | r= ( VOID | ID ) )
            int alt33=2;
            switch ( input.LA(1) ) {
            case FULL_ID:
                {
                alt33=1;
                }
                break;
            case VOID:
            case ID:
                {
                alt33=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 33, 0, input);

                throw nvae;
            }

            switch (alt33) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:613:28: rp= FULL_ID
                    {
                    rp=(Token)match(input,FULL_ID,FOLLOW_FULL_ID_in_rpc_block2524); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    rp_tree = (Object)adaptor.create(rp);
                    adaptor.addChild(root_0, rp_tree);
                    }
                    if ( state.backtracking==0 ) {
                        
                                  String retFull = (rp!=null?rp.getText():null);
                                  int lastDot = retFull.lastIndexOf('.');
                                  retPackage = retFull.substring(0, lastDot); 
                                  retName = retFull.substring(lastDot+1);
                              
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:618:13: r= ( VOID | ID )
                    {
                    r=(Token)input.LT(1);
                    if ( (input.LA(1)>=VOID && input.LA(1)<=ID) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(r));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    if ( state.backtracking==0 ) {
                       retName = (r!=null?r.getText():null); 
                    }

                    }
                    break;

            }

            RIGHTPAREN155=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_rpc_block2541); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTPAREN155_tree = (Object)adaptor.create(RIGHTPAREN155);
            adaptor.addChild(root_0, RIGHTPAREN155_tree);
            }
            if ( state.backtracking==0 ) {

                          rm = service.addRpcMethod((n!=null?n.getText():null), argName, argPackage, retName, retPackage);
                          rm.addAnnotations(proto.annotations, true);
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:621:11: ( rpc_body_block[proto, rm] )?
            int alt34=2;
            switch ( input.LA(1) ) {
                case LEFTCURLY:
                    {
                    alt34=1;
                    }
                    break;
            }

            switch (alt34) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:621:11: rpc_body_block[proto, rm]
                    {
                    pushFollow(FOLLOW_rpc_body_block_in_rpc_block2545);
                    rpc_body_block156=rpc_body_block(proto, rm);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, rpc_body_block156.getTree());

                    }
                    break;

            }

            SEMICOLON157=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_rpc_block2549); if (state.failed) return retval;

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "rpc_block"

    public static class rpc_body_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "rpc_body_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:624:1: rpc_body_block[Proto proto, Service.RpcMethod rm] : LEFTCURLY ( rpc_option[proto, rm] )* RIGHTCURLY ;
    public final ProtoParser.rpc_body_block_return rpc_body_block(Proto proto, Service.RpcMethod rm) throws RecognitionException {
        ProtoParser.rpc_body_block_return retval = new ProtoParser.rpc_body_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token LEFTCURLY158=null;
        Token RIGHTCURLY160=null;
        ProtoParser.rpc_option_return rpc_option159 = null;


        Object LEFTCURLY158_tree=null;
        Object RIGHTCURLY160_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:625:5: ( LEFTCURLY ( rpc_option[proto, rm] )* RIGHTCURLY )
            // com/dyuproject/protostuff/parser/ProtoParser.g:625:9: LEFTCURLY ( rpc_option[proto, rm] )* RIGHTCURLY
            {
            root_0 = (Object)adaptor.nil();

            LEFTCURLY158=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_rpc_body_block2575); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY158_tree = (Object)adaptor.create(LEFTCURLY158);
            adaptor.addChild(root_0, LEFTCURLY158_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:625:19: ( rpc_option[proto, rm] )*
            loop35:
            do {
                int alt35=2;
                switch ( input.LA(1) ) {
                case OPTION:
                    {
                    alt35=1;
                    }
                    break;

                }

                switch (alt35) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:625:19: rpc_option[proto, rm]
            	    {
            	    pushFollow(FOLLOW_rpc_option_in_rpc_body_block2577);
            	    rpc_option159=rpc_option(proto, rm);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, rpc_option159.getTree());

            	    }
            	    break;

            	default :
            	    break loop35;
                }
            } while (true);

            RIGHTCURLY160=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_rpc_body_block2581); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY160_tree = (Object)adaptor.create(RIGHTCURLY160);
            adaptor.addChild(root_0, RIGHTCURLY160_tree);
            }
            if ( state.backtracking==0 ) {

                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "rpc_body_block"

    public static class rpc_option_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "rpc_option"
    // com/dyuproject/protostuff/parser/ProtoParser.g:631:1: rpc_option[Proto proto, Service.RpcMethod rm] : OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON ;
    public final ProtoParser.rpc_option_return rpc_option(Proto proto, Service.RpcMethod rm) throws RecognitionException {
        ProtoParser.rpc_option_return retval = new ProtoParser.rpc_option_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token n=null;
        Token v=null;
        Token OPTION161=null;
        Token LEFTPAREN162=null;
        Token RIGHTPAREN163=null;
        Token ASSIGN164=null;
        Token STRING_LITERAL165=null;
        Token TRUE166=null;
        Token FALSE167=null;
        Token NUMINT168=null;
        Token NUMFLOAT169=null;
        Token SEMICOLON170=null;

        Object n_tree=null;
        Object v_tree=null;
        Object OPTION161_tree=null;
        Object LEFTPAREN162_tree=null;
        Object RIGHTPAREN163_tree=null;
        Object ASSIGN164_tree=null;
        Object STRING_LITERAL165_tree=null;
        Object TRUE166_tree=null;
        Object FALSE167_tree=null;
        Object NUMINT168_tree=null;
        Object NUMFLOAT169_tree=null;
        Object SEMICOLON170_tree=null;


            boolean standard = false;
            String value = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:636:5: ( OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON )
            // com/dyuproject/protostuff/parser/ProtoParser.g:636:9: OPTION ( LEFTPAREN )? n= ( ID | FULL_ID ) ( RIGHTPAREN )? ASSIGN (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT ) SEMICOLON
            {
            root_0 = (Object)adaptor.nil();

            OPTION161=(Token)match(input,OPTION,FOLLOW_OPTION_in_rpc_option2609); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            OPTION161_tree = (Object)adaptor.create(OPTION161);
            adaptor.addChild(root_0, OPTION161_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:636:16: ( LEFTPAREN )?
            int alt36=2;
            switch ( input.LA(1) ) {
                case LEFTPAREN:
                    {
                    alt36=1;
                    }
                    break;
            }

            switch (alt36) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:636:16: LEFTPAREN
                    {
                    LEFTPAREN162=(Token)match(input,LEFTPAREN,FOLLOW_LEFTPAREN_in_rpc_option2611); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    LEFTPAREN162_tree = (Object)adaptor.create(LEFTPAREN162);
                    adaptor.addChild(root_0, LEFTPAREN162_tree);
                    }

                    }
                    break;

            }

            n=(Token)input.LT(1);
            if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                input.consume();
                if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(n));
                state.errorRecovery=false;state.failed=false;
            }
            else {
                if (state.backtracking>0) {state.failed=true; return retval;}
                MismatchedSetException mse = new MismatchedSetException(null,input);
                throw mse;
            }

            // com/dyuproject/protostuff/parser/ProtoParser.g:636:42: ( RIGHTPAREN )?
            int alt37=2;
            switch ( input.LA(1) ) {
                case RIGHTPAREN:
                    {
                    alt37=1;
                    }
                    break;
            }

            switch (alt37) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:636:42: RIGHTPAREN
                    {
                    RIGHTPAREN163=(Token)match(input,RIGHTPAREN,FOLLOW_RIGHTPAREN_in_rpc_option2622); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    RIGHTPAREN163_tree = (Object)adaptor.create(RIGHTPAREN163);
                    adaptor.addChild(root_0, RIGHTPAREN163_tree);
                    }

                    }
                    break;

            }

            ASSIGN164=(Token)match(input,ASSIGN,FOLLOW_ASSIGN_in_rpc_option2625); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            ASSIGN164_tree = (Object)adaptor.create(ASSIGN164);
            adaptor.addChild(root_0, ASSIGN164_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:636:61: (v= ( ID | FULL_ID ) | STRING_LITERAL | TRUE | FALSE | NUMINT | NUMFLOAT )
            int alt38=6;
            switch ( input.LA(1) ) {
            case ID:
            case FULL_ID:
                {
                alt38=1;
                }
                break;
            case STRING_LITERAL:
                {
                alt38=2;
                }
                break;
            case TRUE:
                {
                alt38=3;
                }
                break;
            case FALSE:
                {
                alt38=4;
                }
                break;
            case NUMINT:
                {
                alt38=5;
                }
                break;
            case NUMFLOAT:
                {
                alt38=6;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 38, 0, input);

                throw nvae;
            }

            switch (alt38) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:637:13: v= ( ID | FULL_ID )
                    {
                    v=(Token)input.LT(1);
                    if ( (input.LA(1)>=ID && input.LA(1)<=FULL_ID) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(v));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    if ( state.backtracking==0 ) {
                       standard = true; value = (v!=null?v.getText():null); 
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:638:15: STRING_LITERAL
                    {
                    STRING_LITERAL165=(Token)match(input,STRING_LITERAL,FOLLOW_STRING_LITERAL_in_rpc_option2666); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    STRING_LITERAL165_tree = (Object)adaptor.create(STRING_LITERAL165);
                    adaptor.addChild(root_0, STRING_LITERAL165_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = getStringFromStringLiteral((STRING_LITERAL165!=null?STRING_LITERAL165.getText():null)); 
                    }

                    }
                    break;
                case 3 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:639:15: TRUE
                    {
                    TRUE166=(Token)match(input,TRUE,FOLLOW_TRUE_in_rpc_option2684); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    TRUE166_tree = (Object)adaptor.create(TRUE166);
                    adaptor.addChild(root_0, TRUE166_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "true"; 
                    }

                    }
                    break;
                case 4 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:640:15: FALSE
                    {
                    FALSE167=(Token)match(input,FALSE,FOLLOW_FALSE_in_rpc_option2702); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FALSE167_tree = (Object)adaptor.create(FALSE167);
                    adaptor.addChild(root_0, FALSE167_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = "false"; 
                    }

                    }
                    break;
                case 5 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:641:15: NUMINT
                    {
                    NUMINT168=(Token)match(input,NUMINT,FOLLOW_NUMINT_in_rpc_option2720); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMINT168_tree = (Object)adaptor.create(NUMINT168);
                    adaptor.addChild(root_0, NUMINT168_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = (NUMINT168!=null?NUMINT168.getText():null); 
                    }

                    }
                    break;
                case 6 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:642:15: NUMFLOAT
                    {
                    NUMFLOAT169=(Token)match(input,NUMFLOAT,FOLLOW_NUMFLOAT_in_rpc_option2738); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    NUMFLOAT169_tree = (Object)adaptor.create(NUMFLOAT169);
                    adaptor.addChild(root_0, NUMFLOAT169_tree);
                    }
                    if ( state.backtracking==0 ) {
                       value = Float.valueOf((NUMFLOAT169!=null?NUMFLOAT169.getText():null)).toString(); 
                    }

                    }
                    break;

            }

            SEMICOLON170=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_rpc_option2752); if (state.failed) return retval;
            if ( state.backtracking==0 ) {

                          if(standard)
                              rm.putStandardOption((n!=null?n.getText():null), value);
                          else
                              rm.putExtraOption((n!=null?n.getText():null), value);
                      
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "rpc_option"

    public static class extend_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "extend_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:651:1: extend_block[Proto proto, Message parent] : EXTEND ( FULL_ID | ID ) LEFTCURLY ( extend_body[proto, extension] )* RIGHTCURLY ( ( SEMICOLON )? ) ;
    public final ProtoParser.extend_block_return extend_block(Proto proto, Message parent) throws RecognitionException {
        ProtoParser.extend_block_return retval = new ProtoParser.extend_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token EXTEND171=null;
        Token FULL_ID172=null;
        Token ID173=null;
        Token LEFTCURLY174=null;
        Token RIGHTCURLY176=null;
        Token SEMICOLON177=null;
        ProtoParser.extend_body_return extend_body175 = null;


        Object EXTEND171_tree=null;
        Object FULL_ID172_tree=null;
        Object ID173_tree=null;
        Object LEFTCURLY174_tree=null;
        Object RIGHTCURLY176_tree=null;
        Object SEMICOLON177_tree=null;


            Extension extension = null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:655:5: ( EXTEND ( FULL_ID | ID ) LEFTCURLY ( extend_body[proto, extension] )* RIGHTCURLY ( ( SEMICOLON )? ) )
            // com/dyuproject/protostuff/parser/ProtoParser.g:655:9: EXTEND ( FULL_ID | ID ) LEFTCURLY ( extend_body[proto, extension] )* RIGHTCURLY ( ( SEMICOLON )? )
            {
            root_0 = (Object)adaptor.nil();

            EXTEND171=(Token)match(input,EXTEND,FOLLOW_EXTEND_in_extend_block2785); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            EXTEND171_tree = (Object)adaptor.create(EXTEND171);
            adaptor.addChild(root_0, EXTEND171_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:655:16: ( FULL_ID | ID )
            int alt39=2;
            switch ( input.LA(1) ) {
            case FULL_ID:
                {
                alt39=1;
                }
                break;
            case ID:
                {
                alt39=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 39, 0, input);

                throw nvae;
            }

            switch (alt39) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:656:9: FULL_ID
                    {
                    FULL_ID172=(Token)match(input,FULL_ID,FOLLOW_FULL_ID_in_extend_block2797); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    FULL_ID172_tree = (Object)adaptor.create(FULL_ID172);
                    adaptor.addChild(root_0, FULL_ID172_tree);
                    }
                    if ( state.backtracking==0 ) {

                                  String fullType = (FULL_ID172!=null?FULL_ID172.getText():null);
                                  int lastDot = fullType.lastIndexOf('.');
                                  String packageName = fullType.substring(0, lastDot); 
                                  String type = fullType.substring(lastDot+1);
                                  extension = new Extension(proto, parent, packageName, type);
                                  extension.addAnnotations(proto.annotations, true);
                              
                    }

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:664:9: ID
                    {
                    ID173=(Token)match(input,ID,FOLLOW_ID_in_extend_block2809); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    ID173_tree = (Object)adaptor.create(ID173);
                    adaptor.addChild(root_0, ID173_tree);
                    }
                    if ( state.backtracking==0 ) {
                       
                                  String type = (ID173!=null?ID173.getText():null);
                                  extension = new Extension(proto, parent, null, type);
                                  extension.addAnnotations(proto.annotations, true);
                              
                    }

                    }
                    break;

            }

            LEFTCURLY174=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_extend_block2832); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY174_tree = (Object)adaptor.create(LEFTCURLY174);
            adaptor.addChild(root_0, LEFTCURLY174_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:670:19: ( extend_body[proto, extension] )*
            loop40:
            do {
                int alt40=2;
                switch ( input.LA(1) ) {
                case AT:
                case REQUIRED:
                case OPTIONAL:
                case REPEATED:
                    {
                    alt40=1;
                    }
                    break;

                }

                switch (alt40) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:670:20: extend_body[proto, extension]
            	    {
            	    pushFollow(FOLLOW_extend_body_in_extend_block2835);
            	    extend_body175=extend_body(proto, extension);

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, extend_body175.getTree());

            	    }
            	    break;

            	default :
            	    break loop40;
                }
            } while (true);

            RIGHTCURLY176=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_extend_block2840); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY176_tree = (Object)adaptor.create(RIGHTCURLY176);
            adaptor.addChild(root_0, RIGHTCURLY176_tree);
            }
            if ( state.backtracking==0 ) {

                          if(parent==null)
                              proto.addExtension(extension);
                          else
                              parent.addNestedExtension(extension);
                              
                          if(!proto.annotations.isEmpty())
                              throw new IllegalStateException("Misplaced annotations: " + proto.annotations);
                              
                      
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:679:11: ( ( SEMICOLON )? )
            // com/dyuproject/protostuff/parser/ProtoParser.g:679:12: ( SEMICOLON )?
            {
            // com/dyuproject/protostuff/parser/ProtoParser.g:679:12: ( SEMICOLON )?
            int alt41=2;
            switch ( input.LA(1) ) {
                case SEMICOLON:
                    {
                    alt41=1;
                    }
                    break;
            }

            switch (alt41) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:679:12: SEMICOLON
                    {
                    SEMICOLON177=(Token)match(input,SEMICOLON,FOLLOW_SEMICOLON_in_extend_block2845); if (state.failed) return retval;
                    if ( state.backtracking==0 ) {
                    SEMICOLON177_tree = (Object)adaptor.create(SEMICOLON177);
                    adaptor.addChild(root_0, SEMICOLON177_tree);
                    }

                    }
                    break;

            }


            }


            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "extend_block"

    public static class extend_body_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "extend_body"
    // com/dyuproject/protostuff/parser/ProtoParser.g:682:1: extend_body[Proto proto, Extension extension] : ( message_field[proto, extension] | annotation_entry[proto] );
    public final ProtoParser.extend_body_return extend_body(Proto proto, Extension extension) throws RecognitionException {
        ProtoParser.extend_body_return retval = new ProtoParser.extend_body_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        ProtoParser.message_field_return message_field178 = null;

        ProtoParser.annotation_entry_return annotation_entry179 = null;



        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:683:5: ( message_field[proto, extension] | annotation_entry[proto] )
            int alt42=2;
            switch ( input.LA(1) ) {
            case REQUIRED:
            case OPTIONAL:
            case REPEATED:
                {
                alt42=1;
                }
                break;
            case AT:
                {
                alt42=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 42, 0, input);

                throw nvae;
            }

            switch (alt42) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:683:9: message_field[proto, extension]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_message_field_in_extend_body2873);
                    message_field178=message_field(proto, extension);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, message_field178.getTree());

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:684:9: annotation_entry[proto]
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_annotation_entry_in_extend_body2884);
                    annotation_entry179=annotation_entry(proto);

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, annotation_entry179.getTree());

                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "extend_body"

    public static class ignore_block_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "ignore_block"
    // com/dyuproject/protostuff/parser/ProtoParser.g:687:1: ignore_block : LEFTCURLY ( ignore_block_body )* RIGHTCURLY ;
    public final ProtoParser.ignore_block_return ignore_block() throws RecognitionException {
        ProtoParser.ignore_block_return retval = new ProtoParser.ignore_block_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token LEFTCURLY180=null;
        Token RIGHTCURLY182=null;
        ProtoParser.ignore_block_body_return ignore_block_body181 = null;


        Object LEFTCURLY180_tree=null;
        Object RIGHTCURLY182_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:688:5: ( LEFTCURLY ( ignore_block_body )* RIGHTCURLY )
            // com/dyuproject/protostuff/parser/ProtoParser.g:688:9: LEFTCURLY ( ignore_block_body )* RIGHTCURLY
            {
            root_0 = (Object)adaptor.nil();

            LEFTCURLY180=(Token)match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_ignore_block2908); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            LEFTCURLY180_tree = (Object)adaptor.create(LEFTCURLY180);
            adaptor.addChild(root_0, LEFTCURLY180_tree);
            }
            // com/dyuproject/protostuff/parser/ProtoParser.g:688:19: ( ignore_block_body )*
            loop43:
            do {
                int alt43=2;
                switch ( input.LA(1) ) {
                case ASSIGN:
                case AT:
                case LEFTCURLY:
                case LEFTPAREN:
                case RIGHTPAREN:
                case LEFTSQUARE:
                case RIGHTSQUARE:
                case SEMICOLON:
                case COMMA:
                case PLUS:
                case MINUS:
                case TO:
                case TRUE:
                case FALSE:
                case PKG:
                case SYNTAX:
                case IMPORT:
                case OPTION:
                case MESSAGE:
                case SERVICE:
                case ENUM:
                case REQUIRED:
                case OPTIONAL:
                case REPEATED:
                case EXTENSIONS:
                case EXTEND:
                case GROUP:
                case RPC:
                case RETURNS:
                case INT32:
                case INT64:
                case UINT32:
                case UINT64:
                case SINT32:
                case SINT64:
                case FIXED32:
                case FIXED64:
                case SFIXED32:
                case SFIXED64:
                case FLOAT:
                case DOUBLE:
                case BOOL:
                case STRING:
                case BYTES:
                case DEFAULT:
                case MAX:
                case VOID:
                case ID:
                case FULL_ID:
                case NUMINT:
                case EXP:
                case NUMFLOAT:
                case NUMDOUBLE:
                case HEX_DIGIT:
                case HEX:
                case OCTAL:
                case COMMENT:
                case WS:
                case ESC_SEQ:
                case STRING_LITERAL:
                case UNICODE_ESC:
                case OCTAL_ESC:
                case OPTIONS:
                    {
                    alt43=1;
                    }
                    break;

                }

                switch (alt43) {
            	case 1 :
            	    // com/dyuproject/protostuff/parser/ProtoParser.g:688:19: ignore_block_body
            	    {
            	    pushFollow(FOLLOW_ignore_block_body_in_ignore_block2910);
            	    ignore_block_body181=ignore_block_body();

            	    state._fsp--;
            	    if (state.failed) return retval;
            	    if ( state.backtracking==0 ) adaptor.addChild(root_0, ignore_block_body181.getTree());

            	    }
            	    break;

            	default :
            	    break loop43;
                }
            } while (true);

            RIGHTCURLY182=(Token)match(input,RIGHTCURLY,FOLLOW_RIGHTCURLY_in_ignore_block2913); if (state.failed) return retval;
            if ( state.backtracking==0 ) {
            RIGHTCURLY182_tree = (Object)adaptor.create(RIGHTCURLY182);
            adaptor.addChild(root_0, RIGHTCURLY182_tree);
            }

            }

            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "ignore_block"

    public static class ignore_block_body_return extends ParserRuleReturnScope {
        Object tree;
        public Object getTree() { return tree; }
    };

    // $ANTLR start "ignore_block_body"
    // com/dyuproject/protostuff/parser/ProtoParser.g:691:1: ignore_block_body : ( ( LEFTCURLY )=> ignore_block | ~ RIGHTCURLY );
    public final ProtoParser.ignore_block_body_return ignore_block_body() throws RecognitionException {
        ProtoParser.ignore_block_body_return retval = new ProtoParser.ignore_block_body_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token set184=null;
        ProtoParser.ignore_block_return ignore_block183 = null;


        Object set184_tree=null;

        try {
            // com/dyuproject/protostuff/parser/ProtoParser.g:692:5: ( ( LEFTCURLY )=> ignore_block | ~ RIGHTCURLY )
            int alt44=2;
            switch ( input.LA(1) ) {
            case LEFTCURLY:
                {
                int LA44_1 = input.LA(2);

                if ( (synpred1_ProtoParser()) ) {
                    alt44=1;
                }
                else if ( (true) ) {
                    alt44=2;
                }
                else {
                    if (state.backtracking>0) {state.failed=true; return retval;}
                    NoViableAltException nvae =
                        new NoViableAltException("", 44, 1, input);

                    throw nvae;
                }
                }
                break;
            case ASSIGN:
            case AT:
            case LEFTPAREN:
            case RIGHTPAREN:
            case LEFTSQUARE:
            case RIGHTSQUARE:
            case SEMICOLON:
            case COMMA:
            case PLUS:
            case MINUS:
            case TO:
            case TRUE:
            case FALSE:
            case PKG:
            case SYNTAX:
            case IMPORT:
            case OPTION:
            case MESSAGE:
            case SERVICE:
            case ENUM:
            case REQUIRED:
            case OPTIONAL:
            case REPEATED:
            case EXTENSIONS:
            case EXTEND:
            case GROUP:
            case RPC:
            case RETURNS:
            case INT32:
            case INT64:
            case UINT32:
            case UINT64:
            case SINT32:
            case SINT64:
            case FIXED32:
            case FIXED64:
            case SFIXED32:
            case SFIXED64:
            case FLOAT:
            case DOUBLE:
            case BOOL:
            case STRING:
            case BYTES:
            case DEFAULT:
            case MAX:
            case VOID:
            case ID:
            case FULL_ID:
            case NUMINT:
            case EXP:
            case NUMFLOAT:
            case NUMDOUBLE:
            case HEX_DIGIT:
            case HEX:
            case OCTAL:
            case COMMENT:
            case WS:
            case ESC_SEQ:
            case STRING_LITERAL:
            case UNICODE_ESC:
            case OCTAL_ESC:
            case OPTIONS:
                {
                alt44=2;
                }
                break;
            default:
                if (state.backtracking>0) {state.failed=true; return retval;}
                NoViableAltException nvae =
                    new NoViableAltException("", 44, 0, input);

                throw nvae;
            }

            switch (alt44) {
                case 1 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:692:9: ( LEFTCURLY )=> ignore_block
                    {
                    root_0 = (Object)adaptor.nil();

                    pushFollow(FOLLOW_ignore_block_in_ignore_block_body2941);
                    ignore_block183=ignore_block();

                    state._fsp--;
                    if (state.failed) return retval;
                    if ( state.backtracking==0 ) adaptor.addChild(root_0, ignore_block183.getTree());

                    }
                    break;
                case 2 :
                    // com/dyuproject/protostuff/parser/ProtoParser.g:693:9: ~ RIGHTCURLY
                    {
                    root_0 = (Object)adaptor.nil();

                    set184=(Token)input.LT(1);
                    if ( (input.LA(1)>=ASSIGN && input.LA(1)<=LEFTCURLY)||(input.LA(1)>=LEFTPAREN && input.LA(1)<=OPTIONS) ) {
                        input.consume();
                        if ( state.backtracking==0 ) adaptor.addChild(root_0, (Object)adaptor.create(set184));
                        state.errorRecovery=false;state.failed=false;
                    }
                    else {
                        if (state.backtracking>0) {state.failed=true; return retval;}
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }


                    }
                    break;

            }
            retval.stop = input.LT(-1);

            if ( state.backtracking==0 ) {

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "ignore_block_body"

    // $ANTLR start synpred1_ProtoParser
    public final void synpred1_ProtoParser_fragment() throws RecognitionException {   
        // com/dyuproject/protostuff/parser/ProtoParser.g:692:9: ( LEFTCURLY )
        // com/dyuproject/protostuff/parser/ProtoParser.g:692:10: LEFTCURLY
        {
        match(input,LEFTCURLY,FOLLOW_LEFTCURLY_in_synpred1_ProtoParser2937); if (state.failed) return ;

        }
    }
    // $ANTLR end synpred1_ProtoParser

    // Delegated rules

    public final boolean synpred1_ProtoParser() {
        state.backtracking++;
        int start = input.mark();
        try {
            synpred1_ProtoParser_fragment(); // can never throw exception
        } catch (RecognitionException re) {
            System.err.println("impossible: "+re);
        }
        boolean success = !state.failed;
        input.rewind(start);
        state.backtracking--;
        state.failed=false;
        return success;
    }


 

    public static final BitSet FOLLOW_statement_in_parse178 = new BitSet(new long[]{0x0000000043F80020L});
    public static final BitSet FOLLOW_EOF_in_parse183 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_header_syntax_in_statement211 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_header_package_in_statement222 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_header_import_in_statement233 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_header_option_in_statement244 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_message_block_in_statement255 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_enum_block_in_statement266 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_extend_block_in_statement277 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_service_block_in_statement288 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_annotation_entry_in_statement299 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_var0 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_AT_in_annotation_entry519 = new BitSet(new long[]{0x001FFFFFFFB90000L,0x0000000000000008L});
    public static final BitSet FOLLOW_var_in_annotation_entry521 = new BitSet(new long[]{0x0000000000000102L});
    public static final BitSet FOLLOW_LEFTPAREN_in_annotation_entry534 = new BitSet(new long[]{0x001FFFFFFFB90000L,0x0000000000000008L});
    public static final BitSet FOLLOW_annotation_keyval_in_annotation_entry545 = new BitSet(new long[]{0x0000000000002200L});
    public static final BitSet FOLLOW_COMMA_in_annotation_entry549 = new BitSet(new long[]{0x001FFFFFFFB90000L,0x0000000000000008L});
    public static final BitSet FOLLOW_annotation_keyval_in_annotation_entry551 = new BitSet(new long[]{0x0000000000002200L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_annotation_entry565 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_var_in_annotation_keyval597 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_annotation_keyval599 = new BitSet(new long[]{0x035FFFFFFFBF0000L,0x0000000000000009L});
    public static final BitSet FOLLOW_var_in_annotation_keyval617 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMFLOAT_in_annotation_keyval637 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMINT_in_annotation_keyval657 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMDOUBLE_in_annotation_keyval677 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TRUE_in_annotation_keyval697 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FALSE_in_annotation_keyval717 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_annotation_keyval737 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SYNTAX_in_header_syntax772 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_header_syntax774 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_header_syntax776 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_header_syntax778 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_PKG_in_header_package807 = new BitSet(new long[]{0x003FFFFFFFB90000L,0x0000000000000008L});
    public static final BitSet FOLLOW_FULL_ID_in_header_package810 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_var_in_header_package816 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_header_package821 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IMPORT_in_header_import849 = new BitSet(new long[]{0x0000000000000000L,0x0000000000000001L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_header_import851 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_header_import853 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPTION_in_header_option882 = new BitSet(new long[]{0x0030000000000100L});
    public static final BitSet FOLLOW_LEFTPAREN_in_header_option884 = new BitSet(new long[]{0x0030000000000000L});
    public static final BitSet FOLLOW_set_in_header_option889 = new BitSet(new long[]{0x0000000000000210L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_header_option895 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_header_option898 = new BitSet(new long[]{0x0170000000060000L,0x0000000000000001L});
    public static final BitSet FOLLOW_set_in_header_option916 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_header_option939 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_TRUE_in_header_option957 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_FALSE_in_header_option975 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMINT_in_header_option993 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMFLOAT_in_header_option1011 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_header_option1025 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_MESSAGE_in_message_block1058 = new BitSet(new long[]{0x0010000000000000L});
    public static final BitSet FOLLOW_ID_in_message_block1060 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_LEFTCURLY_in_message_block1073 = new BitSet(new long[]{0x000000007FF800A0L});
    public static final BitSet FOLLOW_message_body_in_message_block1076 = new BitSet(new long[]{0x000000007FF800A0L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_message_block1081 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_message_block_in_message_body1104 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_message_field_in_message_body1115 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_enum_block_in_message_body1126 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_extend_block_in_message_body1137 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_extensions_range_in_message_body1148 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_annotation_entry_in_message_body1159 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_message_option_in_message_body1170 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPTION_in_message_option1201 = new BitSet(new long[]{0x0030000000000100L});
    public static final BitSet FOLLOW_LEFTPAREN_in_message_option1203 = new BitSet(new long[]{0x0030000000000000L});
    public static final BitSet FOLLOW_set_in_message_option1208 = new BitSet(new long[]{0x0000000000000210L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_message_option1214 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_message_option1217 = new BitSet(new long[]{0x0170000000060000L,0x0000000000000001L});
    public static final BitSet FOLLOW_set_in_message_option1235 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_message_option1258 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_TRUE_in_message_option1276 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_FALSE_in_message_option1294 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMINT_in_message_option1312 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMFLOAT_in_message_option1330 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_message_option1344 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_EXTENSIONS_in_extensions_range1377 = new BitSet(new long[]{0x0040000000000000L});
    public static final BitSet FOLLOW_NUMINT_in_extensions_range1381 = new BitSet(new long[]{0x0000000000011000L});
    public static final BitSet FOLLOW_TO_in_extensions_range1395 = new BitSet(new long[]{0x0044000000000000L});
    public static final BitSet FOLLOW_NUMINT_in_extensions_range1401 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_MAX_in_extensions_range1407 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_extensions_range1424 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPTIONAL_in_message_field1458 = new BitSet(new long[]{0x0031FFFC80000000L});
    public static final BitSet FOLLOW_REQUIRED_in_message_field1475 = new BitSet(new long[]{0x0031FFFC80000000L});
    public static final BitSet FOLLOW_REPEATED_in_message_field1492 = new BitSet(new long[]{0x0031FFFC80000000L});
    public static final BitSet FOLLOW_field_type_in_message_field1507 = new BitSet(new long[]{0x001FFFFFFFB90000L,0x0000000000000008L});
    public static final BitSet FOLLOW_var_in_message_field1519 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_message_field1521 = new BitSet(new long[]{0x0040000000000000L});
    public static final BitSet FOLLOW_NUMINT_in_message_field1523 = new BitSet(new long[]{0x0000000000001440L});
    public static final BitSet FOLLOW_field_options_in_message_field1537 = new BitSet(new long[]{0x0000000000001440L});
    public static final BitSet FOLLOW_SEMICOLON_in_message_field1553 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ignore_block_in_message_field1558 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT32_in_field_type1584 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_UINT32_in_field_type1596 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SINT32_in_field_type1608 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FIXED32_in_field_type1620 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SFIXED32_in_field_type1632 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT64_in_field_type1644 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_UINT64_in_field_type1656 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SINT64_in_field_type1668 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FIXED64_in_field_type1680 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SFIXED64_in_field_type1692 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FLOAT_in_field_type1704 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_DOUBLE_in_field_type1716 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_BOOL_in_field_type1728 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_STRING_in_field_type1740 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_BYTES_in_field_type1752 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_GROUP_in_field_type1764 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FULL_ID_in_field_type1776 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_field_type1788 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LEFTSQUARE_in_field_options1815 = new BitSet(new long[]{0x0012000000000000L});
    public static final BitSet FOLLOW_field_options_keyval_in_field_options1817 = new BitSet(new long[]{0x0000000000002800L});
    public static final BitSet FOLLOW_COMMA_in_field_options1830 = new BitSet(new long[]{0x0012000000000000L});
    public static final BitSet FOLLOW_field_options_keyval_in_field_options1832 = new BitSet(new long[]{0x0000000000002800L});
    public static final BitSet FOLLOW_RIGHTSQUARE_in_field_options1837 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_field_options_keyval1864 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_field_options_keyval1870 = new BitSet(new long[]{0x1BD0000000068000L,0x0000000000000001L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_field_options_keyval1873 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMFLOAT_in_field_options_keyval1886 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMINT_in_field_options_keyval1899 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_NUMDOUBLE_in_field_options_keyval1911 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_HEX_in_field_options_keyval1923 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OCTAL_in_field_options_keyval1935 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TRUE_in_field_options_keyval1947 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_FALSE_in_field_options_keyval1963 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_field_options_keyval1977 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_EXP_in_field_options_keyval1989 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_signed_constant_in_field_options_keyval2001 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_MINUS_in_signed_constant2039 = new BitSet(new long[]{0x0010000000000000L});
    public static final BitSet FOLLOW_ID_in_signed_constant2041 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ENUM_in_enum_block2073 = new BitSet(new long[]{0x0010000000000000L});
    public static final BitSet FOLLOW_ID_in_enum_block2075 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_LEFTCURLY_in_enum_block2079 = new BitSet(new long[]{0x0010000000400080L});
    public static final BitSet FOLLOW_enum_body_in_enum_block2091 = new BitSet(new long[]{0x0010000000400080L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_enum_block2096 = new BitSet(new long[]{0x0000000000001002L});
    public static final BitSet FOLLOW_SEMICOLON_in_enum_block2101 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_enum_field_in_enum_body2129 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_enum_option_in_enum_body2140 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPTION_in_enum_option2171 = new BitSet(new long[]{0x0030000000000100L});
    public static final BitSet FOLLOW_LEFTPAREN_in_enum_option2173 = new BitSet(new long[]{0x0030000000000000L});
    public static final BitSet FOLLOW_set_in_enum_option2178 = new BitSet(new long[]{0x0000000000000210L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_enum_option2184 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_enum_option2187 = new BitSet(new long[]{0x0170000000060000L,0x0000000000000001L});
    public static final BitSet FOLLOW_set_in_enum_option2205 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_enum_option2228 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_TRUE_in_enum_option2246 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_FALSE_in_enum_option2264 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMINT_in_enum_option2282 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMFLOAT_in_enum_option2300 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_enum_option2314 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ID_in_enum_field2342 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_enum_field2344 = new BitSet(new long[]{0x0040000000000000L});
    public static final BitSet FOLLOW_NUMINT_in_enum_field2346 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_enum_field2348 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_SERVICE_in_service_block2381 = new BitSet(new long[]{0x0010000000000000L});
    public static final BitSet FOLLOW_ID_in_service_block2383 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_LEFTCURLY_in_service_block2387 = new BitSet(new long[]{0x0000000143F80020L});
    public static final BitSet FOLLOW_service_body_in_service_block2398 = new BitSet(new long[]{0x0000000143F800A0L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_service_block2403 = new BitSet(new long[]{0x0000000000001002L});
    public static final BitSet FOLLOW_SEMICOLON_in_service_block2406 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_rpc_block_in_service_body2436 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_annotation_entry_in_service_body2447 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_RPC_in_rpc_block2478 = new BitSet(new long[]{0x0010000000000000L});
    public static final BitSet FOLLOW_ID_in_rpc_block2482 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_LEFTPAREN_in_rpc_block2484 = new BitSet(new long[]{0x0038000000000000L});
    public static final BitSet FOLLOW_FULL_ID_in_rpc_block2489 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_set_in_rpc_block2497 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_rpc_block2506 = new BitSet(new long[]{0x0000000200000000L});
    public static final BitSet FOLLOW_RETURNS_in_rpc_block2517 = new BitSet(new long[]{0x0000000000000100L});
    public static final BitSet FOLLOW_LEFTPAREN_in_rpc_block2519 = new BitSet(new long[]{0x0038000000000000L});
    public static final BitSet FOLLOW_FULL_ID_in_rpc_block2524 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_set_in_rpc_block2532 = new BitSet(new long[]{0x0000000000000200L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_rpc_block2541 = new BitSet(new long[]{0x0000000000001040L});
    public static final BitSet FOLLOW_rpc_body_block_in_rpc_block2545 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_rpc_block2549 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LEFTCURLY_in_rpc_body_block2575 = new BitSet(new long[]{0x0000000000400080L});
    public static final BitSet FOLLOW_rpc_option_in_rpc_body_block2577 = new BitSet(new long[]{0x0000000000400080L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_rpc_body_block2581 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_OPTION_in_rpc_option2609 = new BitSet(new long[]{0x0030000000000100L});
    public static final BitSet FOLLOW_LEFTPAREN_in_rpc_option2611 = new BitSet(new long[]{0x0030000000000000L});
    public static final BitSet FOLLOW_set_in_rpc_option2616 = new BitSet(new long[]{0x0000000000000210L});
    public static final BitSet FOLLOW_RIGHTPAREN_in_rpc_option2622 = new BitSet(new long[]{0x0000000000000010L});
    public static final BitSet FOLLOW_ASSIGN_in_rpc_option2625 = new BitSet(new long[]{0x0170000000060000L,0x0000000000000001L});
    public static final BitSet FOLLOW_set_in_rpc_option2643 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_STRING_LITERAL_in_rpc_option2666 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_TRUE_in_rpc_option2684 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_FALSE_in_rpc_option2702 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMINT_in_rpc_option2720 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_NUMFLOAT_in_rpc_option2738 = new BitSet(new long[]{0x0000000000001000L});
    public static final BitSet FOLLOW_SEMICOLON_in_rpc_option2752 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_EXTEND_in_extend_block2785 = new BitSet(new long[]{0x0030000000000000L});
    public static final BitSet FOLLOW_FULL_ID_in_extend_block2797 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_ID_in_extend_block2809 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_LEFTCURLY_in_extend_block2832 = new BitSet(new long[]{0x000000005FF800A0L});
    public static final BitSet FOLLOW_extend_body_in_extend_block2835 = new BitSet(new long[]{0x000000005FF800A0L});
    public static final BitSet FOLLOW_RIGHTCURLY_in_extend_block2840 = new BitSet(new long[]{0x0000000000001002L});
    public static final BitSet FOLLOW_SEMICOLON_in_extend_block2845 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_message_field_in_extend_body2873 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_annotation_entry_in_extend_body2884 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LEFTCURLY_in_ignore_block2908 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x000000000000000FL});
    public static final BitSet FOLLOW_ignore_block_body_in_ignore_block2910 = new BitSet(new long[]{0xFFFFFFFFFFFFFFF0L,0x000000000000000FL});
    public static final BitSet FOLLOW_RIGHTCURLY_in_ignore_block2913 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_ignore_block_in_ignore_block_body2941 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_set_in_ignore_block_body2951 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_LEFTCURLY_in_synpred1_ProtoParser2937 = new BitSet(new long[]{0x0000000000000002L});

}